From 546e207d8f565a38f0f4031f8799f0892263ee6c Mon Sep 17 00:00:00 2001 From: lawnjelly Date: Sun, 15 Aug 2021 10:22:27 +0100 Subject: [PATCH] Portals - Fix cull roaming through multiple portals Small bug in the logic, the roaming objects only should be set to done when they have been marked as visible, rather than the first time they are examined. This is because they can be seen in a room through multiple portals, and each needs to be tested until there is either a visible result or all the portals in are visited. --- servers/visual/portals/portal_tracer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/servers/visual/portals/portal_tracer.cpp b/servers/visual/portals/portal_tracer.cpp index f00dfb0a54..8770bde2cf 100644 --- a/servers/visual/portals/portal_tracer.cpp +++ b/servers/visual/portals/portal_tracer.cpp @@ -167,10 +167,10 @@ void PortalTracer::cull_roamers(const VSRoom &p_room, const LocalVector & continue; } - // mark as done - moving.last_tick_hit = _tick; - if (test_cull_inside(moving.exact_aabb, p_planes)) { + // mark as done (and on visible list) + moving.last_tick_hit = _tick; + _result->visible_roamer_pool_ids.push_back(pool_id); } }