diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-11-30 19:27:14 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-11-30 19:27:14 +0300 |
commit | 50a97b0ef2a8365d87a8a57047caccb0c050c56b (patch) | |
tree | fb16dc736890604e468ed379786f45989763f4dd /src/map/pc.c | |
parent | c3c009a7e2c3ad40048935de0d0538081cf613be (diff) | |
download | evol-hercules-50a97b0ef2a8365d87a8a57047caccb0c050c56b.tar.gz evol-hercules-50a97b0ef2a8365d87a8a57047caccb0c050c56b.tar.bz2 evol-hercules-50a97b0ef2a8365d87a8a57047caccb0c050c56b.tar.xz evol-hercules-50a97b0ef2a8365d87a8a57047caccb0c050c56b.zip |
add map flag what prevent from attacking mobs.
New map flag: nopve
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 524c130..fddcdea 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -14,7 +14,9 @@ #include "../../../map/pc.h" #include "map/pc.h" +#include "map/data/mapd.h" #include "map/data/session.h" +#include "map/struct/mapdext.h" #include "map/struct/sessionext.h" int langScriptId; @@ -122,3 +124,21 @@ void epc_unequipitem_pos(struct map_session_data *sd, int *nPtr, int *posPtr) #undef unequipPos #undef unequipPos2 + +bool epc_can_attack (struct map_session_data *sd, int *target_id) +{ + if (!sd) + return false; + + struct MapdExt *data = mapd_get(sd->bl.m); + if (!data) + return true; + if (data->flag.nopve) + { + if (map->id2md(*target_id)) + { + hookStop(); + return false; + } + } +} |