From 95ba1e0e90899a914ce8552d50a69845b19db391 Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Fri, 31 Oct 2008 01:10:07 +0000 Subject: [PATCH] bugfix: when king rat dies, make sure we cancel any remaining puffin()s for new rats --- rc.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/rc.c b/rc.c index c4a7e4b..5083c82 100644 --- a/rc.c +++ b/rc.c @@ -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;