summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-01-20 12:36:28 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-01-20 12:36:28 +0000
commit5c4b7e349d1ac6e251cb6ee139bb365afb083083 (patch)
treef30a1f73db386337c081315888f2e5beb82d99f7 /src/map/status.c
parentb2af6e3afea18f6820bb51280b3f224ce1820f10 (diff)
downloadhercules-5c4b7e349d1ac6e251cb6ee139bb365afb083083.tar.gz
hercules-5c4b7e349d1ac6e251cb6ee139bb365afb083083.tar.bz2
hercules-5c4b7e349d1ac6e251cb6ee139bb365afb083083.tar.xz
hercules-5c4b7e349d1ac6e251cb6ee139bb365afb083083.zip
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12097 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/map/status.c b/src/map/status.c
index ce33bceeb..32d8bfacb 100644
--- a/src/map/status.c
+++ b/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;
}