Prevent snail shells from living forever if they don't hit the ground

This commit is contained in:
Rob Pearce 2008-10-15 10:03:01 +00:00
parent 775c269d74
commit 6e6e07477a
1 changed files with 7 additions and 1 deletions

8
rc.c
View File

@ -1371,7 +1371,7 @@ void die(sprite_t *s) {
}
// recoil (other code will kill us off when this is done
// the shell recoils (other code will kill us off when this is done)
// -become invulnerable temporarily
s->invuln = INVULNTIME*2; // make sure this lasts until we die
// -bounce back
@ -4349,6 +4349,12 @@ void dogravity(sprite_t *s) {
s->climbing = B_FALSE;
}
}
// snail also dies if it's been alive too long
if ((s->id == P_SNAIL) && (s->lives == 0) && (!s->invuln)) {
s->dead = D_FINAL;
}
// don't use an ELSE here because king rat needs to fall through
if (!ontheground) {
//if ((s->id == P_KINGRAT) && ((s->timer1 == KRS_CHARGE) || (s->timer1 == KRS_WALK))) {