소스 검색

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.
lawnjelly 4 년 전
부모
커밋
546e207d8f
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      servers/visual/portals/portal_tracer.cpp

+ 3 - 3
servers/visual/portals/portal_tracer.cpp

@@ -167,10 +167,10 @@ void PortalTracer::cull_roamers(const VSRoom &p_room, const LocalVector<Plane> &
 			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);
 		}
 	}