From e9211aaad32e2f025ed9ee3cd691cb697381852c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 5 Sep 2010 20:51:13 +0000 Subject: [PATCH] - added some NULL pointer checks to the kill CCMD and APlayerPawn::PostBeginPlay. SVN r2697 (trunk) --- src/d_net.cpp | 8 ++++++-- src/p_user.cpp | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/d_net.cpp b/src/d_net.cpp index be592b238..73d800b51 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -2368,7 +2368,7 @@ void Net_DoCommand (int type, BYTE **stream, int player) int killcount = 0; const PClass *cls = PClass::FindClass(classname); - if (classname != NULL) + if (cls != NULL && cls->ActorInfo != NULL) { killcount = KillAll(cls); const PClass *cls_rep = cls->GetReplacement(); @@ -2376,9 +2376,13 @@ void Net_DoCommand (int type, BYTE **stream, int player) { killcount += KillAll(cls_rep); } + Printf ("Killed %d monsters of type %s.\n",killcount, classname); + } + else + { + Printf ("%s is not an actor class.\n", classname); } - Printf ("Killed %d monsters of type %s.\n",killcount, classname); } break; diff --git a/src/p_user.cpp b/src/p_user.cpp index a00843d84..eef4f5025 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -505,7 +505,7 @@ void APlayerPawn::PostBeginPlay() SetupWeaponSlots(); // Voodoo dolls: restore original floorz/ceilingz logic - if (player->mo != this) + if (player == NULL || player->mo != this) { dropoffz = floorz = Sector->floorplane.ZatPoint(x, y); ceilingz = Sector->ceilingplane.ZatPoint(x, y);