From 55feaecf58c764ed8331eb5a39d5202487530ae2 Mon Sep 17 00:00:00 2001 From: AlumiuN Date: Thu, 12 Mar 2026 18:31:51 +1300 Subject: [PATCH] Fix objects leaving the level via an "end of exit tunnel" side causing crashes --- src/Inferno/Game.Object.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Inferno/Game.Object.cpp b/src/Inferno/Game.Object.cpp index 4d00c09e..8f1399cc 100644 --- a/src/Inferno/Game.Object.cpp +++ b/src/Inferno/Game.Object.cpp @@ -186,12 +186,13 @@ namespace Inferno { auto id = TraceSegment(level, obj.Segment, obj.Position); - if ((id == SegID::None || id == SegID::Exit) && obj.Segment == Game::Terrain.ExitTag.Segment) { - id = SegID::Terrain; // Assume that the object has entered the terrain - } - else if (id == SegID::None) { - SetFlag(obj.Flags, ObjectFlag::OutOfBounds); - return false; + if (id == SegID::None || id == SegID::Exit) { + if (obj.Segment == Game::Terrain.ExitTag.Segment) + id = SegID::Terrain; // Assume that the object has entered the terrain + else { + SetFlag(obj.Flags, ObjectFlag::OutOfBounds); + return false; + } } auto ref = Game::GetObjectRef(obj);