From 3a0767592d15288849ad16b6dcd9171af821af33 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 2 Apr 2015 21:13:09 +0300 Subject: map: add post hook for checking is possible equip item. --- src/map/pc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/map/pc.c') diff --git a/src/map/pc.c b/src/map/pc.c index 594b1c0..a914653 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -187,3 +187,17 @@ void epc_validate_levels(void) } hookStop(); } + +int epc_isequip_post(int retVal, struct map_session_data *sd, int *nPtr) +{ + const int n = *nPtr; + if (retVal) + { + if (!sd) + return 0; + + if (n < 0 || n >= MAX_INVENTORY) + return 0; + } + return retVal; +} -- cgit v1.2.3-70-g09d2