From 9c6e40e19264ddac800d794e8e5d3e830bb4012d Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 24 Jun 2008 03:32:28 +0000 Subject: [PATCH] - Fixed: PickNext/PrevWeapon() did not check for NULL player actors. SVN r1046 (trunk) --- docs/rh-log.txt | 1 + src/g_shared/a_weapons.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 623628914..d6be2494b 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,5 @@ June 23, 2008 +- Fixed: PickNext/PrevWeapon() did not check for NULL player actors. - Fixed compilation issues with GCC. - Removed special case for nobotnodes in MAPINFO. diff --git a/src/g_shared/a_weapons.cpp b/src/g_shared/a_weapons.cpp index 1ca3d179e..9ab83623e 100644 --- a/src/g_shared/a_weapons.cpp +++ b/src/g_shared/a_weapons.cpp @@ -733,6 +733,10 @@ AWeapon *PickNextWeapon (player_t *player) { int startslot, startindex; + if (player->mo == NULL) + { + return NULL; + } if (player->ReadyWeapon == NULL || FindMostRecentWeapon (player, &startslot, &startindex)) { int start; @@ -765,6 +769,10 @@ AWeapon *PickPrevWeapon (player_t *player) { int startslot, startindex; + if (player->mo == NULL) + { + return NULL; + } if (player->ReadyWeapon == NULL || FindMostRecentWeapon (player, &startslot, &startindex)) { int start;