- added missing null pointer checks to cheat code.

This commit is contained in:
Christoph Oelckers 2018-12-20 22:09:08 +01:00 committed by drfrag
parent 5c248053f3
commit 91c8177406

View file

@ -561,6 +561,7 @@ FString cht_Morph(player_t *player, PClassActor *morphclass, bool quickundo)
void cht_SetInv(player_t *player, const char *string, int amount, bool beyond)
{
if (!player->mo) return;
IFVIRTUALPTR(player->mo, APlayerPawn, CheatTakeInv)
{
FString message = string;
@ -571,6 +572,7 @@ void cht_SetInv(player_t *player, const char *string, int amount, bool beyond)
void cht_Give (player_t *player, const char *name, int amount)
{
if (!player->mo) return;
IFVIRTUALPTR(player->mo, APlayerPawn, CheatGive)
{
FString namestr = name;
@ -581,6 +583,7 @@ void cht_Give (player_t *player, const char *name, int amount)
void cht_Take (player_t *player, const char *name, int amount)
{
if (!player->mo) return;
IFVIRTUALPTR(player->mo, APlayerPawn, CheatTake)
{
FString namestr = name;
@ -591,6 +594,7 @@ void cht_Take (player_t *player, const char *name, int amount)
void cht_Takeweaps(player_t *player)
{
if (!player->mo) return;
IFVIRTUALPTR(player->mo, APlayerPawn, CheatTakeWeaps)
{
VMValue params[3] = { player->mo };