diff --git a/src/am_map.cpp b/src/am_map.cpp index d2bb52ca6..a317c1190 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -159,6 +159,7 @@ CVAR(Int, am_drawmapback, 1, CVAR_ARCHIVE); CVAR(Bool, am_showkeys, true, CVAR_ARCHIVE); CVAR(Int, am_showtriggerlines, 0, CVAR_ARCHIVE); CVAR(Int, am_showthingsprites, 0, CVAR_ARCHIVE); +CVAR (Bool, am_showkeys_always, false, CVAR_ARCHIVE); CUSTOM_CVAR(Int, am_emptyspacemargin, 0, CVAR_ARCHIVE) { @@ -2942,7 +2943,7 @@ void DAutomap::drawThings () // That is the case for all default keys, however. if (t->IsKindOf(NAME_Key)) { - if (G_SkillProperty(SKILLP_EasyKey)) + if (G_SkillProperty(SKILLP_EasyKey) || am_showkeys_always) { // Already drawn by AM_drawKeys(), so don't draw again color.Index = -1; @@ -3169,7 +3170,7 @@ void DAutomap::Drawer (int bottom) drawWalls(allmap); drawPlayers(); - if (G_SkillProperty(SKILLP_EasyKey)) + if (G_SkillProperty(SKILLP_EasyKey) || am_showkeys_always) drawKeys(); if ((am_cheat >= 2 && am_cheat != 4) || allthings) drawThings(); diff --git a/src/gamedata/textures/texturemanager.cpp b/src/gamedata/textures/texturemanager.cpp index f68f0d478..98b8197bc 100644 --- a/src/gamedata/textures/texturemanager.cpp +++ b/src/gamedata/textures/texturemanager.cpp @@ -1051,13 +1051,14 @@ void FTextureManager::Init() // The Hexen scripts use BLANK as a blank texture, even though it's really not. // I guess the Doom renderer must have clipped away the line at the bottom of - // the texture so it wasn't visible. I'll just map it to 0, so it really is blank. + // the texture so it wasn't visible. Change its use type to a blank null texture to really make it blank. if (gameinfo.gametype == GAME_Hexen) { FTextureID tex = CheckForTexture ("BLANK", ETextureType::Wall, false); if (tex.Exists()) { - SetTranslation (tex, 0); + auto texture = GetTexture(tex, false); + texture->UseType = ETextureType::Null; } } diff --git a/src/r_data/models/models.cpp b/src/r_data/models/models.cpp index 90b93eaa3..1779d2d94 100644 --- a/src/r_data/models/models.cpp +++ b/src/r_data/models/models.cpp @@ -180,7 +180,7 @@ void FModelRenderer::RenderModel(float x, float y, float z, FSpriteModelFrame *s void FModelRenderer::RenderHUDModel(DPSprite *psp, float ofsX, float ofsY) { AActor * playermo = players[consoleplayer].camera; - FSpriteModelFrame *smf = FindModelFrame(playermo->player->ReadyWeapon->GetClass(), psp->GetState()->sprite, psp->GetState()->GetFrame(), false); + FSpriteModelFrame *smf = FindModelFrame(playermo->player->ReadyWeapon->GetClass(), psp->GetSprite(), psp->GetFrame(), false); // [BB] No model found for this sprite, so we can't render anything. if (smf == nullptr) @@ -922,11 +922,10 @@ bool IsHUDModelForPlayerAvailable (player_t * player) DPSprite *psp = player->FindPSprite(PSP_WEAPON); - if (psp == nullptr || psp->GetState() == nullptr) + if (psp == nullptr) return false; - FState* state = psp->GetState(); - FSpriteModelFrame *smf = FindModelFrame(player->ReadyWeapon->GetClass(), state->sprite, state->GetFrame(), false); + FSpriteModelFrame *smf = FindModelFrame(player->ReadyWeapon->GetClass(), psp->GetSprite(), psp->GetFrame(), false); return ( smf != nullptr ); } diff --git a/src/rendering/hwrenderer/scene/hw_weapon.cpp b/src/rendering/hwrenderer/scene/hw_weapon.cpp index db45bb2bb..70940cb51 100644 --- a/src/rendering/hwrenderer/scene/hw_weapon.cpp +++ b/src/rendering/hwrenderer/scene/hw_weapon.cpp @@ -513,7 +513,7 @@ void HWDrawInfo::PreparePlayerSprites(sector_t * viewsector, area_t in_area) for (DPSprite *psp = player->psprites; psp != nullptr && psp->GetID() < PSP_TARGETCENTER; psp = psp->GetNext()) { if (!psp->GetState()) continue; - FSpriteModelFrame *smf = playermo->player->ReadyWeapon ? FindModelFrame(playermo->player->ReadyWeapon->GetClass(), psp->GetState()->sprite, psp->GetState()->GetFrame(), false) : nullptr; + FSpriteModelFrame *smf = playermo->player->ReadyWeapon ? FindModelFrame(playermo->player->ReadyWeapon->GetClass(), psp->GetSprite(), psp->GetFrame(), false) : nullptr; // This is an 'either-or' proposition. This maybe needs some work to allow overlays with weapon models but as originally implemented this just won't work. if (smf && !hudModelStep) continue; if (!smf && hudModelStep) continue; diff --git a/wadsrc/static/zscript/shared/player.txt b/wadsrc/static/zscript/shared/player.txt index fef24b6f3..9cf20b4f3 100644 --- a/wadsrc/static/zscript/shared/player.txt +++ b/wadsrc/static/zscript/shared/player.txt @@ -1621,10 +1621,11 @@ class PlayerPawn : Actor if (!(player.cheats & CF_PREDICTING)) { CheckEnvironment(); - CheckUse(); - CheckUndoMorph(); + // Note that after this point the PlayerPawn may have changed due to getting unmorphed or getting its skull popped so 'self' is no longer safe to use. + // This also must not read mo into a local variable because several functions in this block can change the attached PlayerPawn. + player.mo.CheckUse(); + player.mo.CheckUndoMorph(); // Cycle psprites. - // Note that after this point the PlayerPawn may have changed due to getting unmorphed so 'self' is no longer safe to use. player.mo.TickPSprites(); // Other Counters if (player.damagecount) player.damagecount--; diff --git a/wadsrc/static/zscript/statscreen/statscreen.txt b/wadsrc/static/zscript/statscreen/statscreen.txt index dc6fd446f..7edde60c4 100644 --- a/wadsrc/static/zscript/statscreen/statscreen.txt +++ b/wadsrc/static/zscript/statscreen/statscreen.txt @@ -224,7 +224,7 @@ class StatusScreen abstract play version("2.5") if (y < (NG_STATSY - finished.mFont.GetHeight()*3/4) * CleanYfac) { // don't draw 'finished' if the level name is too tall - y = DrawPatchText(y, finished, "$FINISHED"); + y = DrawPatchText(y, finished, "$WI_FINISHED"); } return y; } @@ -243,7 +243,7 @@ class StatusScreen abstract play version("2.5") { int y = TITLEY * CleanYfac; - y = DrawPatchText(y, entering, "$ENTERING"); + y = DrawPatchText(y, entering, "$WI_ENTERING"); y += entering.mFont.GetHeight() * CleanYfac / 4; DrawName(y, wbs.LName1, lnametexts[1]); }