From cfeba57fa26e90ea23a117b006541f40e72de519 Mon Sep 17 00:00:00 2001 From: Petr Ohlidal Date: Mon, 17 Jun 2024 00:14:42 +0200 Subject: [PATCH] :bug: Fixed crash when `MODIFY_ACTOR` targets nonexistent actor. 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. --- source/main/GameContext.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/main/GameContext.cpp b/source/main/GameContext.cpp index b777d55624..dd06f0e07a 100644 --- a/source/main/GameContext.cpp +++ b/source/main/GameContext.cpp @@ -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();