summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-07-09 01:25:19 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-07-09 01:25:19 +0000
commit8bd7cb69b1242ac0bf42a6bb3f77afda516d1fe9 (patch)
treee8dbfa89bca142b0813f16392a291dcbccc174bb /src/map/unit.c
parent5487756030da284dd45d9114e6c820154607af6c (diff)
downloadhercules-8bd7cb69b1242ac0bf42a6bb3f77afda516d1fe9.tar.gz
hercules-8bd7cb69b1242ac0bf42a6bb3f77afda516d1fe9.tar.bz2
hercules-8bd7cb69b1242ac0bf42a6bb3f77afda516d1fe9.tar.xz
hercules-8bd7cb69b1242ac0bf42a6bb3f77afda516d1fe9.zip
* Added const to the return value of get_timer.
* Added a maximum timer interval. Avoids server shutdowns being delayed for ~10 seconds under some circumstances on windows. * Replaced the fake timer heap (ordered array) with a binary min heap. (actually, this is just a merge and has been in use for months) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12926 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index d836a01e5..8da6ecddd 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -644,7 +644,7 @@ int unit_warp(struct block_list *bl,short m,short x,short y,int type)
int unit_stop_walking(struct block_list *bl,int type)
{
struct unit_data *ud;
- struct TimerData *data;
+ const struct TimerData* td;
unsigned int tick;
nullpo_retr(0, bl);
@@ -654,13 +654,13 @@ int unit_stop_walking(struct block_list *bl,int type)
//NOTE: We are using timer data after deleting it because we know the
//delete_timer function does not messes with it. If the function's
//behaviour changes in the future, this code could break!
- data = get_timer(ud->walktimer);
+ td = get_timer(ud->walktimer);
delete_timer(ud->walktimer, unit_walktoxy_timer);
ud->walktimer = -1;
ud->state.change_walk_target = 0;
tick = gettick();
if ((type&0x02 && !ud->walkpath.path_pos) //Force moving at least one cell.
- || (data && DIFF_TICK(data->tick, tick) <= data->data/2)) //Enough time has passed to cover half-cell
+ || (td && DIFF_TICK(td->tick, tick) <= td->data/2)) //Enough time has passed to cover half-cell
{
ud->walkpath.path_len = ud->walkpath.path_pos+1;
unit_walktoxy_timer(-1, tick, bl->id, ud->walkpath.path_pos);