From 483e25bff316fa48ec013c0c84e8683b18c4026e Mon Sep 17 00:00:00 2001 From: Henrique Gemignani Passos Lima Date: Sat, 3 Apr 2021 04:32:26 +0300 Subject: [PATCH] Don't recreate the nearList for each entity --- Runtime/CStateManager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Runtime/CStateManager.cpp b/Runtime/CStateManager.cpp index 5bb1cdc8e..182706b59 100644 --- a/Runtime/CStateManager.cpp +++ b/Runtime/CStateManager.cpp @@ -2344,6 +2344,7 @@ void CStateManager::MoveActors(float dt) { void CStateManager::CrossTouchActors() { std::array visits{}; + rstl::reserved_vector nearList; for (CEntity* ent : GetActorObjectList()) { if (ent == nullptr) { @@ -2365,7 +2366,7 @@ void CStateManager::CrossTouchActors() { filter = CMaterialFilter::MakeExclude(EMaterialTypes::Trigger); } - rstl::reserved_vector nearList; + nearList.clear(); BuildNearList(nearList, *touchAABB, filter, &actor); for (const auto& id : nearList) {