summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map/pc.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index e28d0545a..d96e69aa5 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -9110,8 +9110,15 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag) {
//OnUnEquip script [Skotlex]
if (sd->inventory_data[n]) {
- if (sd->inventory_data[n]->unequip_script)
- script->run(sd->inventory_data[n]->unequip_script,0,sd->bl.id,npc->fake_nd->bl.id);
+ if (sd->inventory_data[n]->unequip_script) {
+ 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(sd->inventory_data[n]->unequip_script,0,sd->bl.id,npc->fake_nd->bl.id);
+ }
+ else
+ script->run(sd->inventory_data[n]->unequip_script,0,sd->bl.id,npc->fake_nd->bl.id);
+ }
if(itemdb_isspecial(sd->status.inventory[n].card[0]))
; //No cards
else {
@@ -9121,8 +9128,16 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag) {
continue;
if ( ( data = itemdb->exists(sd->status.inventory[n].card[i]) ) != NULL ) {
- if( data->unequip_script )
- script->run(data->unequip_script,0,sd->bl.id,npc->fake_nd->bl.id);
+ 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(data->unequip_script,0,sd->bl.id,npc->fake_nd->bl.id);
+ }
+ else
+ script->run(data->unequip_script,0,sd->bl.id,npc->fake_nd->bl.id);
+ }
}
}