summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-24 23:46:35 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-24 23:46:35 +0300
commit7942a5a3d653589631850b6560e04503bf304175 (patch)
tree0e025006ecba4b179bddb6cb64bbe976b2331264 /src/map/pc.c
parent083278009ab0d94d305754c14c7372b61f410931 (diff)
downloadevol-hercules-7942a5a3d653589631850b6560e04503bf304175.tar.gz
evol-hercules-7942a5a3d653589631850b6560e04503bf304175.tar.bz2
evol-hercules-7942a5a3d653589631850b6560e04503bf304175.tar.xz
evol-hercules-7942a5a3d653589631850b6560e04503bf304175.zip
Impliment AllowPickup item_db.conf option.
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index b593682..fba2441 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -14,8 +14,10 @@
#include "../../../map/pc.h"
#include "map/pc.h"
+#include "map/data/itemd.h"
#include "map/data/mapd.h"
#include "map/data/session.h"
+#include "map/struct/itemdext.h"
#include "map/struct/mapdext.h"
#include "map/struct/sessionext.h"
@@ -145,3 +147,21 @@ bool epc_can_attack (struct map_session_data *sd, int *target_id)
}
return true;
}
+
+int epc_takeitem(struct map_session_data *sd __attribute__ ((unused)),
+ struct flooritem_data *fitem)
+{
+ if (!fitem)
+ return 0;
+
+ struct ItemdExt *data = itemd_get_by_item(&fitem->item_data);
+ if (!data)
+ return 1;
+
+ if (!data->allowPickup)
+ {
+ hookStop();
+ return 0;
+ }
+ return 1;
+}