From 05afabf037f8a9c765af20661607b88f5eb91415 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Fri, 4 Nov 2022 08:15:21 +1000 Subject: [PATCH] Only calculate lookingatprop when necessary --- src/game/lv.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/game/lv.c b/src/game/lv.c index 2151bd092..3ac7bb4db 100644 --- a/src/game/lv.c +++ b/src/game/lv.c @@ -1357,10 +1357,15 @@ Gfx *lvRender(Gfx *gdl) // Calculate lookingatprop profileStart(PROFILEMARKER_LVR_LOOKINGAT); - if (PLAYERCOUNT() == 1 - || g_Vars.coopplayernum >= 0 - || g_Vars.antiplayernum >= 0 - || (weaponHasFlag(bgunGetWeaponNum(HAND_RIGHT), WEAPONFLAG_AIMTRACK) && bmoveIsInSightAimMode())) { + + // Only calculate lookingatprop if: + // we are using the R-aimer in solo missions (including coop/anti), or + // we are using the R-aimer in 1 player combat simulator, or + // we are using the R-aimer in 2+ player combat simulator with a gun that uses prop tracking, or + // we are playing Holo 1 (Looking Around), which uses lookingatprop + if ((bmoveIsInSightAimMode() && ( + PLAYERCOUNT() == 1 || !g_Vars.normmplayerisrunning || weaponHasFlag(bgunGetWeaponNum(HAND_RIGHT), WEAPONFLAG_AIMTRACK))) + || (g_Vars.stagenum == STAGE_CITRAINING && (g_StageFlags & 0x00040000))) { g_Vars.currentplayer->lookingatprop.prop = func0f061d54(HAND_RIGHT, 0, 0); if (g_Vars.currentplayer->lookingatprop.prop) {