Issue information

Issue ID
#6107
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Jun 25, 2012 11:11
Last Post
Hercules Elf Bot
Jul 1, 2012 12:05
Confirmation
Yes (3)
No (0)

Hercules Elf Bot - Jun 25, 2012 11:11

Originally posted by [b]Daegaladh[/b]
This fix is for unequipping items that the character cannot equip anymore on mapchange and relog, like supernovice's link effect and some other cases.

I tested it on kRO and it simply unequips the items on mapchange or relog, but you're able to keep the items equipped on that map until you leave the game or the map.



[CODE]
Index: pc.c
===================================================================
--- pc.c (revision 16345)
+++ pc.c (working copy)
@@ -4423,7 +4423,7 @@
int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y, clr_type clrtype)
{
struct party_data *p;
- int m;
+ int i, m;

nullpo_ret(sd);

@@ -4475,6 +4475,12 @@
sce->timer = add_timer(gettick() + skill_get_time(SG_KNOWLEDGE, sce->val1), status_change_timer, sd->bl.id, SC_KNOWLEDGE);
}
}
+ // Unequip items that no longer can be equipped [Daegaladh]
+ 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);
+ }
if (battle_config.clear_unit_onwarp&BL_PC)
skill_clear_unitgroup(&sd->bl);
party_send_dot_remove(sd); //minimap dot fix [Kevin]
[/CODE]


[CODE]
Index: map.c
===================================================================
--- map.c (revision 16345)
+++ map.c (working copy)
@@ -1666,6 +1666,8 @@
*------------------------------------------*/
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 &&
@@ -1733,7 +1735,13 @@
status_change_end(&sd->bl, SC_SPIRIT, INVALID_TIMER);
}
}
-
+ // Unequip items that no longer can be equipped [Daegaladh]
+ 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);
[/CODE]

This post has been edited by Daegaladh on Jun 25, 2012 14:51

Hercules Elf Bot - Jun 25, 2012 14:19

Originally posted by [b]malufett[/b]
what is pj?

Hercules Elf Bot - Jun 25, 2012 14:51

Originally posted by [b]Daegaladh[/b]
I mean character, sorry

Hercules Elf Bot - Jul 1, 2012 12:05

Originally posted by [b]Ind[/b]
Thank you very much, fixed in [rev=16360]