summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-14 08:05:38 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-14 08:05:38 +0000
commitfc71573dc0e2558ad4c977534d716d971ac798f2 (patch)
tree07aa868cbb65b7c0ecc2aef59767fa3eaad7f941
parent8389c6c0cf7ffc335adff2f3aab44913fb5b1c2d (diff)
downloadhercules-fc71573dc0e2558ad4c977534d716d971ac798f2.tar.gz
hercules-fc71573dc0e2558ad4c977534d716d971ac798f2.tar.bz2
hercules-fc71573dc0e2558ad4c977534d716d971ac798f2.tar.xz
hercules-fc71573dc0e2558ad4c977534d716d971ac798f2.zip
Fixed one condition incorrectly modified in r12358, which caused dynamically unloaded mobs to never spawn once they've been unloaded once (bugreport:1178)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12361 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--src/map/unit.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index 5a7a62b96..62638e252 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1893,12 +1893,14 @@ int unit_free(struct block_list *bl, int clrtype)
if(md->spawn)
{
md->spawn->active--;
- md->spawn->num--;
- if( !md->spawn->state.dynamic && md->spawn->num == 0 )
- {// Last freed mob is responsible for deallocating the group's spawn data.
- aFree(md->spawn);
- md->spawn = NULL;
+ if( !md->spawn->state.dynamic )
+ {// permanently remove the mob
+ if( --md->spawn->num == 0 )
+ {// Last freed mob is responsible for deallocating the group's spawn data.
+ aFree(md->spawn);
+ md->spawn = NULL;
+ }
}
}
if(md->base_status) {