Skip to content

Commit

Permalink
🐛 Fixed crash when MODIFY_ACTOR targets nonexistent actor.
Browse files Browse the repository at this point in the history
This crash happened to me repeatedly when I removed an actor which was constantly exploding and resetting - apparently the MODIFY_ACTOR was queued when DELETE_ACTOR was already in queue.
  • Loading branch information
ohlidalp committed Jun 17, 2024
1 parent a77549d commit cfeba57
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions source/main/GameContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,11 @@ void GameContext::ModifyActor(ActorModifyRequest& rq)
{
ActorPtr actor = m_actor_manager.GetActorById(rq.amr_actor);

if (!actor)
{
return;
}

if (rq.amr_type == ActorModifyRequest::Type::SOFT_RESET)
{
actor->SoftReset();
Expand Down

0 comments on commit cfeba57

Please sign in to comment.