From 8be70ae836682c10a7fbe666076215ca89133d93 Mon Sep 17 00:00:00 2001 From: tjohnman Date: Mon, 21 Oct 2024 22:27:56 +0200 Subject: [PATCH 1/2] Check for valid pointer before calling CastSeeRays method. --- Source/Managers/MovableMan.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Managers/MovableMan.cpp b/Source/Managers/MovableMan.cpp index 033d349236..68cb257fd1 100644 --- a/Source/Managers/MovableMan.cpp +++ b/Source/Managers/MovableMan.cpp @@ -1371,7 +1371,7 @@ void MovableMan::Update() { [&](int start, int end) { ZoneScopedN("Actors See"); for (int i = start; i < end; ++i) { - m_Actors[i]->CastSeeRays(); + if (m_Actors[i]) m_Actors[i]->CastSeeRays(); } }); From bd4fc2194aa49c7b022cd9ed8965b47a108a6ac7 Mon Sep 17 00:00:00 2001 From: Causeless Date: Tue, 12 Nov 2024 22:10:13 +0000 Subject: [PATCH 2/2] Adding comments and tweaked formatting --- Source/Managers/MovableMan.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Managers/MovableMan.cpp b/Source/Managers/MovableMan.cpp index 68cb257fd1..3692c6b0d0 100644 --- a/Source/Managers/MovableMan.cpp +++ b/Source/Managers/MovableMan.cpp @@ -1371,7 +1371,11 @@ void MovableMan::Update() { [&](int start, int end) { ZoneScopedN("Actors See"); for (int i = start; i < end; ++i) { - if (m_Actors[i]) m_Actors[i]->CastSeeRays(); + // TODO - this null check really shouldn't be required. There's almost definitely an issue where the actor update can somehow fuck with this mid-update + // this is VERY bad, and needs investigation! + if (m_Actors[i]) { + m_Actors[i]->CastSeeRays(); + } } });