summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-02-22 23:37:41 +0100
committerKenpachi Developer <Kenpachi.Developer@gmx.de>2020-02-23 00:07:31 +0100
commitc2dba5f3e8d6b730ef9009037e261f2349f6888a (patch)
tree17bc5d2be263214188374cea6e06482d8c0e4292 /src/map/pc.c
parent45f7b27d8655fbb331eb17f55112f7301434a686 (diff)
downloadhercules-c2dba5f3e8d6b730ef9009037e261f2349f6888a.tar.gz
hercules-c2dba5f3e8d6b730ef9009037e261f2349f6888a.tar.bz2
hercules-c2dba5f3e8d6b730ef9009037e261f2349f6888a.tar.xz
hercules-c2dba5f3e8d6b730ef9009037e261f2349f6888a.zip
Remove unequip_restricted_equipment dependency from OnEquipScript zone validation
The execution of the OnEquipScript should be prevented, regardless of the unequip_restricted_equipment configuration, if the item is restricted in that zone.
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 1939b750f..d9cbc7b7b 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -10263,8 +10263,12 @@ static int pc_equipitem(struct map_session_data *sd, int n, int req_pos)
clif->skillinfoblock(sd);
//OnEquip script [Skotlex]
- if (id->equip_script)
- script->run_item_equip_script(sd, id, npc->fake_nd->bl.id);
+ if (id->equip_script != NULL) {
+ ARR_FIND(0, map->list[sd->bl.m].zone->disabled_items_count, i, map->list[sd->bl.m].zone->disabled_items[i] == id->nameid);
+
+ if (i == map->list[sd->bl.m].zone->disabled_items_count)
+ script->run_item_equip_script(sd, id, npc->fake_nd->bl.id);
+ }
if(itemdb_isspecial(sd->status.inventory[n].card[0]))
; //No cards
@@ -10274,8 +10278,14 @@ static int pc_equipitem(struct map_session_data *sd, int n, int req_pos)
if (!sd->status.inventory[n].card[i])
continue;
if ( ( data = itemdb->exists(sd->status.inventory[n].card[i]) ) != NULL ) {
- if (data->equip_script)
- script->run_item_equip_script(sd, data, npc->fake_nd->bl.id);
+ if (data->equip_script != NULL) {
+ int j;
+
+ ARR_FIND(0, map->list[sd->bl.m].zone->disabled_items_count, j, map->list[sd->bl.m].zone->disabled_items[j] == sd->status.inventory[n].card[i]);
+
+ if (j == map->list[sd->bl.m].zone->disabled_items_count)
+ script->run_item_equip_script(sd, data, npc->fake_nd->bl.id);
+ }
}
}
}