From 0dc348599028316ea28c5fd6ffc23ed9555ec05c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 2 Mar 2019 22:10:44 +0100 Subject: [PATCH] - fixed: in CollectWithinRadius, make pos a value variable instead of a reference. The underlying data here can be reallocated and invalidate what it points to. --- src/g_shared/a_dynlight.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_shared/a_dynlight.cpp b/src/g_shared/a_dynlight.cpp index d1b91af9d..edc2e4dfd 100644 --- a/src/g_shared/a_dynlight.cpp +++ b/src/g_shared/a_dynlight.cpp @@ -539,7 +539,7 @@ void FDynamicLight::CollectWithinRadius(const DVector3 &opos, FSection *section, bool hitonesidedback = false; for (unsigned i = 0; i < collected_ss.Size(); i++) { - auto &pos = collected_ss[i].pos; + auto pos = collected_ss[i].pos; section = collected_ss[i].sect; touching_sector = AddLightNode(§ion->lighthead, section, this, touching_sector);