summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-02 17:43:30 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-02 17:43:30 +0000
commitbdd10b430d4d949d5cdd97295ffb0c9887a7c211 (patch)
tree41f37d83ba99b11a3e017d59b6ef15aa267b9a74 /src/map/status.c
parent1c8b4e651ae7f17b0652e1f352ac5246a883b4a0 (diff)
downloadhercules-bdd10b430d4d949d5cdd97295ffb0c9887a7c211.tar.gz
hercules-bdd10b430d4d949d5cdd97295ffb0c9887a7c211.tar.bz2
hercules-bdd10b430d4d949d5cdd97295ffb0c9887a7c211.tar.xz
hercules-bdd10b430d4d949d5cdd97295ffb0c9887a7c211.zip
- Cleaned up mmo_auth, as this function was quite filled with sql memory leaks! Also improved the code a little.
- Made account_id and char_id ints in login.h (since they are that type in mmo_charstatus) - Corrected/simplified the re-walk code when an object's speed changes. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10125 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 6aae8ba20..d3891898c 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -2728,12 +2728,6 @@ void status_calc_bl_sub_pc(struct map_session_data *sd, unsigned long flag)
}
}
- if(flag&SCB_SPEED) {
- clif_updatestatus(sd,SP_SPEED);
- if (sd->ud.walktimer != -1) //Re-walk to adjust speed. [Skotlex]
- unit_walktoxy(&sd->bl, sd->ud.to_x, sd->ud.to_y, sd->ud.state.walk_easy);
- }
-
if(flag&(SCB_INT|SCB_MAXSP|SCB_VIT|SCB_MAXHP))
status_calc_regen(&sd->bl, status, &sd->regen);
@@ -2761,6 +2755,8 @@ void status_calc_bl_sub_pc(struct map_session_data *sd, unsigned long flag)
clif_updatestatus(sd,SP_FLEE1);
if(flag&SCB_ASPD)
clif_updatestatus(sd,SP_ASPD);
+ if(flag&SCB_SPEED)
+ clif_updatestatus(sd,SP_SPEED);
if(flag&(SCB_BATK|SCB_WATK))
clif_updatestatus(sd,SP_ATK1);
if(flag&SCB_DEF)
@@ -3003,14 +2999,15 @@ void status_calc_bl(struct block_list *bl, unsigned long flag)
}
if(flag&SCB_SPEED) {
+ struct unit_data *ud = unit_bl2ud(bl);
status->speed = status_calc_speed(bl, sc, b_status->speed);
- if (!sd)
- { //Player speed is updated on calc_bl_sub_pc
- struct unit_data *ud = unit_bl2ud(bl);
- if (ud && ud->walktimer != -1) //Re-walk to adjust speed. [Skotlex]
- unit_walktoxy(bl, ud->to_x, ud->to_y, ud->state.walk_easy);
- }
+ //Re-walk to adjust speed (we do not check if walktimer != -1
+ //because if you step on something while walking, the moment this
+ //piece of code triggers the walk-timer is set on -1) [Skotlex]
+ if (ud)
+ ud->state.change_walk_target = 1;
}
+
if(flag&SCB_CRI && b_status->cri) {
if (status->luk == b_status->luk)
status->cri = status_calc_critical(bl, sc, b_status->cri);