Browse Source

Fixed yet another status code crash, this time when a stonecursed mob with high maxhp changes class to a Poring (see bugreport:621)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12097 54d463be-8e91-2dee-dedb-b68131a5f0ec
ultramage 17 years ago
parent
commit
cbd15650f1
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/map/status.c

+ 7 - 0
src/map/status.c

@@ -6780,7 +6780,14 @@ int status_change_timer(int tid, unsigned int tick, int id, int data)
 		}
 		if(--(sce->val3) > 0) {
 			if(++(sce->val4)%5 == 0 && status->hp > status->max_hp/4)
+			{
+				bool flag;
+				map_freeblock_lock();
 				status_zap(bl, sce->val2, 0);
+				flag = !sc->data[type];
+				map_freeblock_unlock();
+				if (flag) return 0; //target died, SC cancelled already.
+			}
 			sc_timer_next(1000+tick,status_change_timer, bl->id, data );
 			return 0;
 		}