From 098dbcf672e04657553b9f1629550e6bc8771af3 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Fri, 29 Nov 2013 10:58:35 -0200 Subject: Minor improvement pc_checkitem is now triggered by @reloaditemdb to ensure modified conditions are respected, also a performance boost that causes the itemlist/cartlist/storagelist/gstoragelist lookups to only be triggered on demand instead of on every teleport. Closes #219 Fixed ancient monster ai bug that caused mobs to consider themselves elegible targets, which would waste status_check_skilluse and battle_check_target calls. Signed-off-by: shennetsind --- src/map/pc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/map/pc.c') diff --git a/src/map/pc.c b/src/map/pc.c index b5fa9268e..84880c24d 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -1124,6 +1124,9 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim sd->delayed_damage = 0; + if( battle_config.item_check ) + sd->state.itemcheck = 1; + // Event Timers for( i = 0; i < MAX_EVENTTIMER; i++ ) sd->eventtimer[i] = INVALID_TIMER; @@ -9060,7 +9063,7 @@ int pc_checkitem(struct map_session_data *sd) if( sd->state.vending ) //Avoid reorganizing items when we are vending, as that leads to exploits (pointed out by End of Exam) return 0; - if( battle_config.item_check ) { // check for invalid(ated) items + if( sd->state.itemcheck ) { // check for invalid(ated) items for( i = 0; i < MAX_INVENTORY; i++ ) { id = sd->status.inventory[i].nameid; @@ -9088,7 +9091,7 @@ int pc_checkitem(struct map_session_data *sd) } } - if (sd->state.gmaster_flag) { + if (sd->guild) { struct guild_storage *guild_storage = gstorage->id2storage2(sd->guild->guild_id); if (guild_storage) { for( i = 0; i < MAX_GUILD_STORAGE; i++ ) { @@ -9101,6 +9104,7 @@ int pc_checkitem(struct map_session_data *sd) } } } + sd->state.itemcheck = 0; } for( i = 0; i < MAX_INVENTORY; i++) { -- cgit v1.2.3-60-g2f50