Explorar o código

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://svn.code.sf.net/p/rathena/svn/trunk@12361 54d463be-8e91-2dee-dedb-b68131a5f0ec
ultramage %!s(int64=17) %!d(string=hai) anos
pai
achega
b8cf860055
Modificáronse 1 ficheiros con 7 adicións e 5 borrados
  1. 7 5
      src/map/unit.c

+ 7 - 5
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) {