From 99c66e1bcc248563c7617d470b8523a03b4858f5 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 30 Jun 2018 15:11:21 +0300 Subject: [PATCH] - fixed crash when actor is destroyed during spawning This only applies to spawning via summon... CCMDs Now 'summon decal 0' no longer crashes the game (cherry picked from commit 43b94d829e2ec6d2af2906daec5722f1c0250e6a) --- src/d_net.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/d_net.cpp b/src/d_net.cpp index 245470319..4920cb9d4 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -2373,16 +2373,17 @@ void Net_DoCommand (int type, uint8_t **stream, int player) spawned->flags &= ~MF_FRIENDLY; spawned->health = spawned->SpawnHealth(); } - } - if (type >= DEM_SUMMON2 && type <= DEM_SUMMONFOE2) - { - spawned->Angles.Yaw = source->Angles.Yaw - angle; - spawned->tid = tid; - spawned->special = special; - for(i = 0; i < 5; i++) { - spawned->args[i] = args[i]; + + if (type >= DEM_SUMMON2 && type <= DEM_SUMMONFOE2) + { + spawned->Angles.Yaw = source->Angles.Yaw - angle; + spawned->tid = tid; + spawned->special = special; + for(i = 0; i < 5; i++) { + spawned->args[i] = args[i]; + } + if(tid) spawned->AddToHash(); } - if(tid) spawned->AddToHash(); } } }