- Duke: Clean up player/actor accesses in game.cpp.

This commit is contained in:
Mitchell Richters 2023-10-03 10:58:23 +11:00
parent 9086f90e75
commit 411115304a

View file

@ -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);