From 411115304ab66a906c9b95e63786aaf856aa41a9 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Tue, 3 Oct 2023 10:58:23 +1100 Subject: [PATCH] - Duke: Clean up player/actor accesses in `game.cpp`. --- source/games/duke/src/game.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/games/duke/src/game.cpp b/source/games/duke/src/game.cpp index a284b2731..e5c914a51 100644 --- a/source/games/duke/src/game.cpp +++ b/source/games/duke/src/game.cpp @@ -917,7 +917,9 @@ CCMD(changewalltexture) FTextureID tile = TexMan.CheckForTexture(argv[1], ETextureType::Any); if (!tile.isValid()) tile = tileGetTextureID((int)strtol(argv[1], nullptr, 10)); HitInfoBase hit; - hitscan(getPlayer(0)->GetActor()->spr.pos, getPlayer(0)->cursector, DVector3(getPlayer(0)->GetActor()->spr.Angles.Yaw.ToVector(), 0) * 1024, hit, CLIPMASK1); + const auto p = getPlayer(0); + const auto pact = p->GetActor(); + hitscan(pact->spr.pos, p->cursector, DVector3(pact->spr.Angles.Yaw.ToVector(), 0) * 1024, hit, CLIPMASK1); if (hit.hitWall) { hit.hitWall->setwalltexture(tile);