From b105897d9f49833574bde44fe0160b2522946014 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 13 Sep 2022 23:32:38 +0200 Subject: [PATCH] - 'effector->GetOwner()' was used a lot in this block... --- source/games/duke/src/player_r.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index 82c7b53e1..1a7116ae9 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -267,20 +267,20 @@ static void shootweapon(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int DukeStatIterator its(STAT_EFFECTOR); while (auto effector = its.Next()) { - if (effector->sector() == hit.hitSector && effector->spr.picnum == SECTOREFFECTOR && effector->GetOwner() - && effector->spr.lotag == SE_7_TELEPORT) + auto Owner = effector->GetOwner(); + if (effector->sector() == hit.hitSector && effector->spr.picnum == SECTOREFFECTOR && Owner && effector->spr.lotag == SE_7_TELEPORT) { DVector3 npos; - npos.XY() = hit.hitpos.XY() + (effector->GetOwner()->spr.pos.XY() - effector->spr.pos.XY()); + npos.XY() = hit.hitpos.XY() + (Owner->spr.pos.XY() - effector->spr.pos.XY()); if (hit.hitSector->lotag == 161) { - npos.Z = effector->GetOwner()->sector()->floorz; + npos.Z = Owner->sector()->floorz; } else { - npos.Z = effector->GetOwner()->sector()->ceilingz; + npos.Z = Owner->sector()->ceilingz; } - hitscan(npos, effector->GetOwner()->sector(), DVector3(ang.ToVector() * 1024, zvel * 0.25), hit, CLIPMASK1); + hitscan(npos, Owner->sector(), DVector3(ang.ToVector() * 1024, zvel * 0.25), hit, CLIPMASK1); break; } }