diff options
author | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-07-01 12:05:02 +0000 |
---|---|---|
committer | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-07-01 12:05:02 +0000 |
commit | 2fd87c062a72a6a17fccdaa822086221baae0e15 (patch) | |
tree | 836c2a8e15bd07cf4af256b8bc3a28872795df23 /src/map/map.c | |
parent | 23a884ba4d24efdb80fc7a81ac2199e5ec7a2bb0 (diff) | |
download | hercules-2fd87c062a72a6a17fccdaa822086221baae0e15.tar.gz hercules-2fd87c062a72a6a17fccdaa822086221baae0e15.tar.bz2 hercules-2fd87c062a72a6a17fccdaa822086221baae0e15.tar.xz hercules-2fd87c062a72a6a17fccdaa822086221baae0e15.zip |
Fixed bugreport:6107 item restrictions are now checked upon logoff/mapchange which leads to gear being unequipped when conditions are not met. Super-Mega-Ultra Thanks/Credits To: Daegaladh
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16360 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/map.c')
-rw-r--r-- | src/map/map.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/map/map.c b/src/map/map.c index 073901204..3831f7e98 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -1663,8 +1663,9 @@ void map_deliddb(struct block_list *bl) /*========================================== * Standard call when a player connection is closed. *------------------------------------------*/ -int map_quit(struct map_session_data *sd) -{ +int map_quit(struct map_session_data *sd) { + int i; + if(!sd->state.active) { //Removing a player that is not active. struct auth_node *node = chrif_search(sd->status.account_id); if (node && node->char_id == sd->status.char_id && @@ -1722,8 +1723,7 @@ int map_quit(struct map_session_data *sd) status_change_end(&sd->bl, SC_SLOWCAST, INVALID_TIMER); status_change_end(&sd->bl, SC_CRITICALWOUND, INVALID_TIMER); } - if (battle_config.debuff_on_logout&2) - { + if (battle_config.debuff_on_logout&2) { status_change_end(&sd->bl, SC_MAXIMIZEPOWER, INVALID_TIMER); status_change_end(&sd->bl, SC_MAXOVERTHRUST, INVALID_TIMER); status_change_end(&sd->bl, SC_STEELBODY, INVALID_TIMER); @@ -1733,6 +1733,12 @@ int map_quit(struct map_session_data *sd) } } + for( i = 0; i < EQI_MAX; i++ ) { + if( sd->equip_index[ i ] >= 0 ) + if( !pc_isequip( sd , sd->equip_index[ i ] ) ) + pc_unequipitem( sd , sd->equip_index[ i ] , 2 ); + } + // Return loot to owner if( sd->pd ) pet_lootitem_drop(sd->pd, sd); |