From 8de669ac9b3d53144e201abf62982d0e31d56940 Mon Sep 17 00:00:00 2001 From: James Haley Date: Sat, 26 Feb 2011 03:36:24 +0000 Subject: P_GiveBody seems to need a P_SubstNullMobj, otherwise a crash occurs in P_DestroyConverter when it tries to give items to players that aren't in the game... needs add'l verification. Also fixed first frame of the good ending (how the hell did that get screwed up??) Subversion-branch: /branches/strife-branch Subversion-revision: 2279 --- src/strife/f_finale.c | 2 +- src/strife/p_inter.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/strife/f_finale.c b/src/strife/f_finale.c index 1761ad44..32d09021 100644 --- a/src/strife/f_finale.c +++ b/src/strife/f_finale.c @@ -329,7 +329,7 @@ static void F_DoSlideShow(void) break; case SLIDE_GOODEND1: // state #10 - slideshow_panel = DEH_String("SS4F2"); + slideshow_panel = DEH_String("SS4F1"); S_StartMusic(mus_happy); I_StartVoice(DEH_String("RIE01")); slideshow_state = SLIDE_GOODEND2; diff --git a/src/strife/p_inter.c b/src/strife/p_inter.c index 7eed93bc..e2f54adc 100644 --- a/src/strife/p_inter.c +++ b/src/strife/p_inter.c @@ -244,8 +244,10 @@ boolean P_GiveBody(player_t* player, int num) maxhealth = MAXHEALTH + player->stamina; - if(num >= 0) // haleyjd 09/23/10: fixed to give proper amount of health + if(num >= 0) // haleyjd 20100923: fixed to give proper amount of health { + mobj_t *mo; // haleyjd 20110225: needed below... + // any healing to do? if(player->health >= maxhealth) return false; @@ -256,7 +258,11 @@ boolean P_GiveBody(player_t* player, int num) player->health = maxhealth; // Set mo->health for consistency. - player->mo->health = player->health; + // haleyjd 20110225: Seems Strife can call this on a NULL player->mo + // when giving items to players that are not in the game... + // STRIFE-FIXME: needs major verification! + mo = P_SubstNullMobj(player->mo); + mo->health = player->health; } else { -- cgit v1.2.3