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;