diff options
author | shennetsind <ind@henn.et> | 2013-11-29 10:58:35 -0200 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-11-29 10:58:35 -0200 |
commit | 098dbcf672e04657553b9f1629550e6bc8771af3 (patch) | |
tree | 6dfe6dd587591249faf9d278c1da8d3c71d30a66 /src/map/pc.c | |
parent | 61b02a2b161deb19be4de8e627ebe0f4ffd9a238 (diff) | |
download | hercules-098dbcf672e04657553b9f1629550e6bc8771af3.tar.gz hercules-098dbcf672e04657553b9f1629550e6bc8771af3.tar.bz2 hercules-098dbcf672e04657553b9f1629550e6bc8771af3.tar.xz hercules-098dbcf672e04657553b9f1629550e6bc8771af3.zip |
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 <ind@henn.et>
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 8 |
1 files changed, 6 insertions, 2 deletions
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++) { |