summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-02-22 23:20:04 +0100
committerKenpachi Developer <Kenpachi.Developer@gmx.de>2020-02-23 00:07:23 +0100
commit45f7b27d8655fbb331eb17f55112f7301434a686 (patch)
treee5eff4cbbb8c35221c71cc35abdf7e00e49efdc6 /src/map/pc.c
parent9106bbab19b4feaa4623a3b8e5d59e08ef73b640 (diff)
downloadhercules-45f7b27d8655fbb331eb17f55112f7301434a686.tar.gz
hercules-45f7b27d8655fbb331eb17f55112f7301434a686.tar.bz2
hercules-45f7b27d8655fbb331eb17f55112f7301434a686.tar.xz
hercules-45f7b27d8655fbb331eb17f55112f7301434a686.zip
Remove unequip_restricted_equipment dependency from OnUnequipScript zone validation
The execution of the OnUnequipScript 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, 5 insertions, 13 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index c96e957c7..1939b750f 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -10464,12 +10464,8 @@ static int pc_unequipitem(struct map_session_data *sd, int n, int flag)
//OnUnEquip script [Skotlex]
if (sd->inventory_data[n] != NULL) {
if (sd->inventory_data[n]->unequip_script != NULL) {
- if (battle_config.unequip_restricted_equipment & 1) {
- ARR_FIND(0, map->list[sd->bl.m].zone->disabled_items_count, i, map->list[sd->bl.m].zone->disabled_items[i] == sd->status.inventory[n].nameid);
- if (i == map->list[sd->bl.m].zone->disabled_items_count)
- script->run_item_unequip_script(sd, sd->inventory_data[n], npc->fake_nd->bl.id);
- }
- else
+ ARR_FIND(0, map->list[sd->bl.m].zone->disabled_items_count, i, map->list[sd->bl.m].zone->disabled_items[i] == sd->status.inventory[n].nameid);
+ if (i == map->list[sd->bl.m].zone->disabled_items_count)
script->run_item_unequip_script(sd, sd->inventory_data[n], npc->fake_nd->bl.id);
}
if (itemdb_isspecial(sd->status.inventory[n].card[0]) == false) {
@@ -10480,14 +10476,10 @@ static int pc_unequipitem(struct map_session_data *sd, int n, int flag)
if ((data = itemdb->exists(sd->status.inventory[n].card[i])) != NULL) {
if (data->unequip_script) {
- if (battle_config.unequip_restricted_equipment & 2) {
- 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_unequip_script(sd, data, npc->fake_nd->bl.id);
- } else {
+ 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_unequip_script(sd, data, npc->fake_nd->bl.id);
- }
}
}