summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/init.c1
-rw-r--r--src/map/pc.c14
-rw-r--r--src/map/pc.h2
3 files changed, 17 insertions, 0 deletions
diff --git a/src/map/init.c b/src/map/init.c
index a9cc312..4ea0622 100644
--- a/src/map/init.c
+++ b/src/map/init.c
@@ -156,6 +156,7 @@ HPExport void plugin_init (void)
addHookPost("clif->move", eclif_move);
addHookPost("map->addflooritem", emap_addflooritem_post);
addHookPost("skill->check_condition_castend", eskill_check_condition_castend_post);
+ addHookPost("pc->isequip", epc_isequip_post);
langScriptId = script->add_str("Lang");
}
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;
+}
diff --git a/src/map/pc.h b/src/map/pc.h
index 8b1bd7e..dd6572c 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -23,4 +23,6 @@ int epc_takeitem(TBL_PC *sd, TBL_ITEM *fitem);
void epc_validate_levels(void);
+int epc_isequip_post(int retVal, struct map_session_data *sd, int *nPtr);
+
#endif // EVOL_MAP_PC