summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-07-16 10:34:16 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-07-16 10:34:16 +0000
commit43cc789c05999bed1e50126867887212bc1fc346 (patch)
tree7d469d17fed704054425c38f298cf39fe8fbb6d8 /src/common
parent9c2f6c141486530c03ceb01261bd975a95a7f9b8 (diff)
downloadhercules-43cc789c05999bed1e50126867887212bc1fc346.tar.gz
hercules-43cc789c05999bed1e50126867887212bc1fc346.tar.bz2
hercules-43cc789c05999bed1e50126867887212bc1fc346.tar.xz
hercules-43cc789c05999bed1e50126867887212bc1fc346.zip
* Added a check to make sure only released timers are acquired from the free list.
* Changed TIMER_MAX_INTERVAL to 1 second (was set to 1 minute by mistake). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12963 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common')
-rw-r--r--src/common/timer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/timer.c b/src/common/timer.c
index df227cb57..882ddd705 100644
--- a/src/common/timer.c
+++ b/src/common/timer.c
@@ -22,7 +22,7 @@
// If the server can't handle processing thousands of monsters
// or many connected clients, please increase TIMER_MIN_INTERVAL.
#define TIMER_MIN_INTERVAL 50
-#define TIMER_MAX_INTERVAL 60000
+#define TIMER_MAX_INTERVAL 1000
// timers (array)
static struct TimerData* timer_data = NULL;
@@ -324,8 +324,8 @@ static int acquire_timer(void)
while( free_timer_list_num )
{
int pos = --free_timer_list_num;
- if( free_timer_list[pos] < timer_data_num )
- {
+ if( free_timer_list[pos] < timer_data_num && timer_data[free_timer_list[pos]].type == 0 )
+ {// freed and released
tid = free_timer_list[pos];
break;
}