Attempts to fix crashes in level transition

This commit is contained in:
Rob Pearce 2008-10-27 05:36:25 +00:00
parent 94cdda9e3c
commit 93f05fd5c7
2 changed files with 12 additions and 1 deletions

9
rc.c
View File

@ -2911,6 +2911,7 @@ if (s->id == P_PUFF) printf("PUFF WITH DOOMCOUNT!\n");
player->climbing = B_FALSE; player->climbing = B_FALSE;
player->netting = B_FALSE; player->netting = B_FALSE;
player->slamming = B_FALSE; player->slamming = B_FALSE;
player->jumping = B_FALSE;
// keep turning towards exit (2 degrees at a time) // keep turning towards exit (2 degrees at a time)
s->angle += (PCTURN * (M_PI/180)); s->angle += (PCTURN * (M_PI/180));
@ -3220,6 +3221,10 @@ void drawlevel(void) {
setdefaults(cloud); setdefaults(cloud);
// redo image // redo image
cloud->img =rotozoomSurfaceXY(imageset[P_PINKCLOUD].img[F_WALK1],0,1,1,0); cloud->img =rotozoomSurfaceXY(imageset[P_PINKCLOUD].img[F_WALK1],0,1,1,0);
// set player image
player->img = imageset[player->id].img[F_SHOOT];
// create buffer for player background // create buffer for player background
@ -3321,6 +3326,7 @@ void drawlevel(void) {
SDL_BlitSurface(temps, &area, screen, &dst); SDL_BlitSurface(temps, &area, screen, &dst);
// remember area behind player // remember area behind player
player->img = imageset[player->id].img[F_SHOOT];
grabbehind(player, playerbg); grabbehind(player, playerbg);
grabbehind(cloud, cloudbg); grabbehind(cloud, cloudbg);
@ -3384,6 +3390,7 @@ void drawlevel(void) {
SDL_BlitSurface(temps, &area, screen, &dst); SDL_BlitSurface(temps, &area, screen, &dst);
// remember area behind player // remember area behind player
player->img = imageset[player->id].img[F_SHOOT];
grabbehind(player, playerbg); grabbehind(player, playerbg);
grabbehind(cloud, cloudbg); grabbehind(cloud, cloudbg);
@ -3447,6 +3454,7 @@ void drawlevel(void) {
SDL_BlitSurface(temps, &area, screen, &dst); SDL_BlitSurface(temps, &area, screen, &dst);
// remember area behind player // remember area behind player
player->img = imageset[player->id].img[F_SHOOT];
grabbehind(player, playerbg); grabbehind(player, playerbg);
grabbehind(cloud, cloudbg); grabbehind(cloud, cloudbg);
@ -3512,6 +3520,7 @@ void drawlevel(void) {
// remember area behind player // remember area behind player
player->img = imageset[player->id].img[F_SHOOT];
grabbehind(player, playerbg); grabbehind(player, playerbg);
grabbehind(cloud, cloudbg); grabbehind(cloud, cloudbg);

View File

@ -1682,7 +1682,9 @@ void drawsprite(sprite_t *s) {
} }
/* make red if required */ /* make red if required */
if (s->angry && s->id != P_BLACKCLOUD) { if (s->angry && s->id != P_BLACKCLOUD) {
frame += (MAXFRAMES*2); if (s != player) {
frame += (MAXFRAMES*2);
}
} }
if (s->id == P_MOVINGCARD) { if (s->id == P_MOVINGCARD) {