From c7272075d3c873b7e5d9583d4789a6fa1d7b562b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 11 Apr 2010 06:43:42 +0000 Subject: [PATCH] - added a few NULL pointer checks to protect against problems caused by actors being spawned during engine shutdown. SVN r2279 (trunk) --- src/p_mobj.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index dbb3f38b7e..37276c9493 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -593,7 +593,10 @@ bool AActor::SetState (FState *newstate) newstate = newstate->GetNextState(); } while (tics == 0); - screen->StateChanged(this); + if (screen != NULL) + { + screen->StateChanged(this); + } return true; } @@ -653,7 +656,10 @@ bool AActor::SetStateNF (FState *newstate) newstate = newstate->GetNextState(); } while (tics == 0); - screen->StateChanged(this); + if (screen != NULL) + { + screen->StateChanged(this); + } return true; } @@ -3693,7 +3699,10 @@ AActor *AActor::StaticSpawn (const PClass *type, fixed_t ix, fixed_t iy, fixed_t { level.total_items++; } - screen->StateChanged(actor); + if (screen != NULL) + { + screen->StateChanged(actor); + } return actor; }