mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 21:11:39 +00:00
- added missing null pointer checks to cheat code.
This commit is contained in:
parent
d049b3b3eb
commit
66a2cdb6e9
1 changed files with 4 additions and 0 deletions
|
@ -549,6 +549,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;
|
||||
|
@ -559,6 +560,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;
|
||||
|
@ -569,6 +571,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;
|
||||
|
@ -579,6 +582,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 };
|
||||
|
|
Loading…
Reference in a new issue