summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-01-13 10:38:54 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-01-13 10:38:54 +0000
commit9d1b39d3facc6d9f1268e036e7b23bd410c683ec (patch)
tree355fc27fb7d8431737b6d5fd2b62b3b00c7baf21 /src/map/unit.c
parent4ae49e2bfd82567f5747eaed81f02f515e556441 (diff)
downloadhercules-9d1b39d3facc6d9f1268e036e7b23bd410c683ec.tar.gz
hercules-9d1b39d3facc6d9f1268e036e7b23bd410c683ec.tar.bz2
hercules-9d1b39d3facc6d9f1268e036e7b23bd410c683ec.tar.xz
hercules-9d1b39d3facc6d9f1268e036e7b23bd410c683ec.zip
Mobs with nonzero spawn time can now be cached as well, saving some more cpu/memory (bugreport:1197).
Fixed dynamic mobs being unloaded without stopping their respawn timer. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13445 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index 6695abf6b..787b25765 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -2029,7 +2029,12 @@ int unit_free(struct block_list *bl, int clrtype)
case BL_MOB:
{
struct mob_data *md = (struct mob_data*)bl;
- if( md->deletetimer != -1 )
+ if( md->spawn_timer != INVALID_TIMER )
+ {
+ delete_timer(md->spawn_timer,mob_delayspawn);
+ md->spawn_timer = INVALID_TIMER;
+ }
+ if( md->deletetimer != INVALID_TIMER )
{
delete_timer(md->deletetimer,mob_timer_delete);
md->deletetimer = INVALID_TIMER;