summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorAnnieRuru <jeankof@ymail.com>2014-09-26 00:34:01 +0800
committerAnnieRuru <jeankof@ymail.com>2014-09-26 00:34:01 +0800
commit30d748f4ab332b501b6db5ce59421ea42387a8b8 (patch)
tree21a4caf88ecb42e1b9364e8b9d3a5d60612444e9 /src/map/pc.c
parent2bc31ad003a8c3283043c62d012a57edde794fba (diff)
downloadhercules-30d748f4ab332b501b6db5ce59421ea42387a8b8.tar.gz
hercules-30d748f4ab332b501b6db5ce59421ea42387a8b8.tar.bz2
hercules-30d748f4ab332b501b6db5ce59421ea42387a8b8.tar.xz
hercules-30d748f4ab332b501b6db5ce59421ea42387a8b8.zip
Fix bug 8271
http://hercules.ws/board/tracker/issue-8271-map-zone-db-disabled-items/ me careless, didn't know that when the item are disabled, OnUnequip shouldn't trigger it was my pull request so me go fix it thx to kyeme for the report
Diffstat (limited to 'src/map/pc.c')
-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);
+ }
}
}