Skip to content

Commit bb33ed0

Browse files
committed
Fixed crash when an actor is removed mid-update
1 parent 8253715 commit bb33ed0

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Source/Managers/MovableMan.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,14 +1399,14 @@ void MovableMan::Update() {
13991399
[&](int start, int end) {
14001400
ZoneScopedN("Actors See");
14011401
for (int i = start; i < end; ++i) {
1402-
// TODO - this null check really shouldn't be required. There's almost definitely an issue where the actor update can somehow fuck with this mid-update
1403-
// this is VERY bad, and needs investigation!
1404-
if (m_Actors[i]) {
1405-
m_Actors[i]->CastSeeRays();
1406-
}
1402+
m_Actors[i]->CastSeeRays();
14071403
}
14081404
});
14091405

1406+
// TODO- right now RemoveActor just removes to actor directly (instead of setting it disabled and delaying the actual remoal), meaning that actorsSeeFuture must be finished immediately
1407+
// This isn't ideal, as we'd prefer to be able to run the actor/items/particle update in parallel
1408+
actorsSeeFuture.wait();
1409+
14101410
{
14111411
ZoneScopedN("Actors Update");
14121412

@@ -1478,8 +1478,9 @@ void MovableMan::Update() {
14781478
particle->PostUpdate();
14791479
}
14801480
}
1481-
1482-
actorsSeeFuture.wait();
1481+
1482+
// See above TODO - this is only commented out because of how RemoveActor currently works
1483+
//actorsSeeFuture.wait();
14831484
} // namespace RTE
14841485

14851486
//////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)