bugfix: when king rat dies, make sure we cancel any remaining puffin()s for new rats

This commit is contained in:
Rob Pearce 2008-10-31 01:10:07 +00:00
parent 6036625699
commit 95ba1e0e90
1 changed files with 12 additions and 2 deletions

14
rc.c
View File

@ -1317,7 +1317,8 @@ void die(sprite_t *s) {
}
}
} else if (s == boss) { // boss effects
// stop screen shaking
sprite_t *ss;
// stop screen shaking and rats falling
if (player->powerup == PW_RATSHAKE) {
losepowerup(player);
}
@ -1327,6 +1328,16 @@ void die(sprite_t *s) {
// death timer
s->timer3 = BOSSDIETIME;
if (s->id == P_KINGRAT) {
// stop rats from coming in
for (ss = sprite ; ss ; ss = ss->next) {
if ((s->id == P_PUFF) && (ss->timer3 == P_RAT)) {
// cancel the puffin
ss->timer3 = -1;
}
}
}
// give a permenant powerup!
switch (s->id) {
case P_KINGRAT:
@ -6180,7 +6191,6 @@ void doice(void) {
changed = B_TRUE;
break;
case T_LAND:
printf("bb\n");
curlevel->map2[yy*LEVELW+xx] = getuniq(T_ICETOP);
changed = B_TRUE;
break;