From c2dba5f3e8d6b730ef9009037e261f2349f6888a Mon Sep 17 00:00:00 2001 From: Kenpachi Developer Date: Sat, 22 Feb 2020 23:37:41 +0100 Subject: 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. --- src/map/pc.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src') 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); + } } } } -- cgit v1.2.3-70-g09d2