From 41874769aa3a57337a0d58ac779592302c207d0a Mon Sep 17 00:00:00 2001 From: Diavolo Date: Sun, 26 Dec 2021 17:33:48 +0100 Subject: [PATCH] Address review --- src/Components/Modules/Elevators.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Components/Modules/Elevators.cpp b/src/Components/Modules/Elevators.cpp index 224aba21..f9f42354 100644 --- a/src/Components/Modules/Elevators.cpp +++ b/src/Components/Modules/Elevators.cpp @@ -36,12 +36,6 @@ namespace Components // like later versions of the game do if (!trace->startsolid || elevatorSetting >= Elevators::ENABLED) { - pml->groundTrace = *trace; - - const auto fraction = trace->fraction; - ps->origin[0] += fraction * (point[0] - ps->origin[0]); - ps->origin[1] += fraction * (point[1] - ps->origin[1]); - ps->origin[2] += fraction * (point[2] - ps->origin[2]); break; } } @@ -58,6 +52,13 @@ namespace Components } } + pml->groundTrace = *trace; + + const auto fraction = trace->fraction; + ps->origin[0] += fraction * (point[0] - ps->origin[0]); + ps->origin[1] += fraction * (point[1] - ps->origin[1]); + ps->origin[2] += fraction * (point[2] - ps->origin[2]); + return 1; }