diff options
author | Haru <haru@dotalux.com> | 2020-06-01 06:08:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-01 06:08:36 +0200 |
commit | 380eba3b364b915cff8b34a343d482454a0bccc0 (patch) | |
tree | cb073b896747e19cb7524d525bf7e69d2339e460 | |
parent | 8162eb2c42716d7e8069c6353f73d3e999dbbd67 (diff) | |
parent | 31234f79616a9da1d2cd7c3ef92116e448656a43 (diff) | |
download | hercules-380eba3b364b915cff8b34a343d482454a0bccc0.tar.gz hercules-380eba3b364b915cff8b34a343d482454a0bccc0.tar.bz2 hercules-380eba3b364b915cff8b34a343d482454a0bccc0.tar.xz hercules-380eba3b364b915cff8b34a343d482454a0bccc0.zip |
Merge pull request #2745 from Kenpachi2k13/unequip_on_login
Prevent unequipping items on login before calculating the character's status data
-rw-r--r-- | src/map/clif.c | 6 | ||||
-rw-r--r-- | src/map/pc.c | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 8688ee771..649df3e33 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -10863,6 +10863,12 @@ static void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) clif->updatestatus(sd, SP_SKILLPOINT); clif->initialstatus(sd); + // Unequip items which can't be equipped by the character. + for (int i = 0; i < EQI_MAX; i++) { + if (sd->equip_index[i] >= 0 && pc->isequip(sd , sd->equip_index[i]) == 0) + pc->unequipitem(sd, sd->equip_index[i], PCUNEQUIPITEM_FORCE); + } + if (pc_isfalcon(sd)) { int sc_icn = status->get_sc_icon(SC_FALCON); int sc_typ = status->get_sc_relevant_bl_types(SC_FALCON); diff --git a/src/map/pc.c b/src/map/pc.c index 41e182cca..c1261c839 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -5915,11 +5915,6 @@ static int pc_setpos(struct map_session_data *sd, unsigned short map_index, int status_change_end(&sd->bl, SC_CLOAKINGEXCEED, INVALID_TIMER); } - for (int i = 0; i < EQI_MAX; i++) { - if (sd->equip_index[i] >= 0 && pc->isequip(sd , sd->equip_index[i]) == 0) - pc->unequipitem(sd, sd->equip_index[i], PCUNEQUIPITEM_FORCE); - } - if ((battle_config.clear_unit_onwarp & BL_PC) != 0) skill->clear_unitgroup(&sd->bl); |