From 317b8c1d7c9841e78a95723e7e2393e3532baa45 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 21 Feb 2009 23:17:37 +0000 Subject: [PATCH] - Fixed: Heretic's fullscreen HUD crashed when the player had armor without a valid icon. SVN r1436 (trunk) --- docs/rh-log.txt | 3 +++ src/g_heretic/heretic_sbar.cpp | 13 ++++++++----- src/g_level.cpp | 2 ++ src/p_mobj.cpp | 4 ---- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 9c837e133f..4eb084d48b 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,7 @@ February 21, 2009 (Changes by Graf Zahl) +- Fixed: Heretic's fullscreen HUD crashed when the player had armor without + a valid icon. +- Fixed: The StrifePlayer was missing a RunHealth setting. - Fixed: Untranslated colors in fonts had an alpha value of 0 but need 255. - Fixed: The Doom status bar's ammo display may not use the INDEXFONT for the alternative HUD. Instead it has to create a separate one out of the diff --git a/src/g_heretic/heretic_sbar.cpp b/src/g_heretic/heretic_sbar.cpp index 4583189f92..d9cabf2d52 100644 --- a/src/g_heretic/heretic_sbar.cpp +++ b/src/g_heretic/heretic_sbar.cpp @@ -549,11 +549,14 @@ private: if (armor != NULL && armor->Amount != 0) { pic = TexMan(armor->Icon); - screen->DrawTexture (pic, 56, -24, - DTA_HUDRules, HUD_Normal, - DTA_LeftOffset, pic->GetWidth()/2, - DTA_TopOffset, pic->GetHeight(), - TAG_DONE); + if (pic != NULL) + { + screen->DrawTexture (pic, 56, -24, + DTA_HUDRules, HUD_Normal, + DTA_LeftOffset, pic->GetWidth()/2, + DTA_TopOffset, pic->GetHeight(), + TAG_DONE); + } DrBNumberOuter (armor->Amount, 5, -43); } diff --git a/src/g_level.cpp b/src/g_level.cpp index 8c2e068863..92e992e264 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -922,6 +922,8 @@ void G_DoLoadLevel (int position, bool autosave) } P_SetupLevel (level.mapname, position); + P_CompleteWeaponSetup(consoleplayer, players[consoleplayer].mo->GetClass()); + AM_LevelInit(); // [RH] Start lightning, if MAPINFO tells us to diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index a4b22b175e..3b1e93f5c0 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -3769,10 +3769,6 @@ APlayerPawn *P_SpawnPlayer (FMapThing *mthing, bool tempplayer) FBehavior::StaticStartTypedScripts (SCRIPT_Respawn, p->mo, true); } } - if (playernum == consoleplayer) - { - P_CompleteWeaponSetup(consoleplayer, mobj->GetClass()); - } return mobj; }