From 8bd7cb69b1242ac0bf42a6bb3f77afda516d1fe9 Mon Sep 17 00:00:00 2001 From: FlavioJS Date: Wed, 9 Jul 2008 01:25:19 +0000 Subject: * 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 --- src/map/unit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/map/unit.c') 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); -- cgit v1.2.3-70-g09d2