diff --git a/src/m_cheat.cpp b/src/m_cheat.cpp index 45175c50ac..b50c908e84 100644 --- a/src/m_cheat.cpp +++ b/src/m_cheat.cpp @@ -604,7 +604,7 @@ void GiveSpawner (player_t *player, const PClass *type, int amount) void cht_Give (player_t *player, const char *name, int amount) { - bool giveall; + enum { ALL_NO, ALL_YES, ALL_YESYES } giveall; int i; const PClass *type; @@ -616,9 +616,17 @@ void cht_Give (player_t *player, const char *name, int amount) return; } - giveall = (stricmp (name, "all") == 0); + giveall = ALL_NO; + if (stricmp (name, "all") == 0) + { + giveall = ALL_YES; + } + else if (stricmp (name, "everything") == 0) + { + giveall = ALL_YES; + } - if (giveall || stricmp (name, "health") == 0) + if (stricmp (name, "health") == 0) { if (amount > 0) { @@ -643,9 +651,6 @@ void cht_Give (player_t *player, const char *name, int amount) player->health = deh.GodHealth; } } - - if (!giveall) - return; } if (giveall || stricmp (name, "backpack") == 0) @@ -760,7 +765,7 @@ void cht_Give (player_t *player, const char *name, int amount) player->weapons.LocateWeapon(type, NULL, NULL)) { AWeapon *def = (AWeapon*)GetDefaultByType (type); - if (!(def->WeaponFlags & WIF_CHEATNOTWEAPON)) + if (giveall == ALL_YESYES || !(def->WeaponFlags & WIF_CHEATNOTWEAPON)) { GiveSpawner (player, type, 1); } @@ -786,7 +791,7 @@ void cht_Give (player_t *player, const char *name, int amount) !type->IsDescendantOf (RUNTIME_CLASS(APowerup)) && !type->IsDescendantOf (RUNTIME_CLASS(AArmor))) { - GiveSpawner (player, type, 1); + GiveSpawner (player, type, amount <= 0 ? def->MaxAmount : amount); } } } @@ -804,7 +809,7 @@ void cht_Give (player_t *player, const char *name, int amount) AInventory *def = (AInventory*)GetDefaultByType (type); if (def->Icon.isValid()) { - GiveSpawner (player, type, 1); + GiveSpawner (player, type, amount <= 0 ? def->MaxAmount : amount); } } }