From 550d687bcfe15ab272233161f63de2b3f5e0a103 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 22 Jun 2006 20:52:49 +0000 Subject: [PATCH] - Fixed: The check to prevent items from being given to dead players didn't work properly. It has to be done in the cheat code, not in APlayerPawn::AddInventory. - Fixed: The medikit and stimpack used a MaxAmount of 100 so that stamina upgrades were ineffective. SVN r214 (trunk) --- docs/rh-log.txt | 5 +++++ src/m_cheat.cpp | 17 +++++++++++------ src/p_user.cpp | 3 --- wadsrc/decorate/doom/doomhealth.txt | 2 -- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 1d6e0722d..bde40ac0b 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,9 @@ June 22, 2006 (Changes by Graf Zahl) +- Fixed: The check to prevent items from being given to dead players + didn't work properly. It has to be done in the cheat code, not in + APlayerPawn::AddInventory. +- Fixed: The medikit and stimpack used a MaxAmount of 100 so that + stamina upgrades were ineffective. - Fixed: Jumping and crouching at the same time created jerky results. Now jumping takes precedence and you can't crouch while pressing the jump key (which causes an uncrouch.) diff --git a/src/m_cheat.cpp b/src/m_cheat.cpp index 1cc5ce34a..6a2aabced 100644 --- a/src/m_cheat.cpp +++ b/src/m_cheat.cpp @@ -69,7 +69,7 @@ void cht_DoCheat (player_t *player, int cheat) switch (cheat) { case CHT_IDDQD: - if (!(player->cheats & CF_GODMODE)) + if (!(player->cheats & CF_GODMODE) && player->playerstate == PST_LIVE) { if (player->mo) player->mo->health = deh.GodHealth; @@ -162,7 +162,7 @@ void cht_DoCheat (player_t *player, int cheat) break; case CHT_CHAINSAW: - if (player->mo != NULL) + if (player->mo != NULL && player->health >= 0) { type = PClass::FindClass ("Chainsaw"); if (player->mo->FindInventory (type) == NULL) @@ -178,7 +178,7 @@ void cht_DoCheat (player_t *player, int cheat) break; case CHT_POWER: - if (player->mo != NULL) + if (player->mo != NULL && player->health >= 0) { item = player->mo->FindInventory (RUNTIME_CLASS(APowerWeaponLevel2)); if (item != NULL) @@ -226,7 +226,7 @@ void cht_DoCheat (player_t *player, int cheat) { level.flags ^= LEVEL_ALLMAP; } - else if (player->mo != NULL) + else if (player->mo != NULL && player->health >= 0) { item = player->mo->FindInventory (BeholdPowers[i]); if (item == NULL) @@ -256,7 +256,7 @@ void cht_DoCheat (player_t *player, int cheat) break; case CHT_HEALTH: - if (player->mo != NULL) + if (player->mo != NULL && player->playerstate == PST_LIVE) { player->health = player->mo->health = player->mo->GetDefault()->health; msg = GStrings("TXT_CHEATHEALTH"); @@ -362,7 +362,7 @@ void cht_DoCheat (player_t *player, int cheat) break; case CHT_LEGO: - if (player->mo != NULL) + if (player->mo != NULL && player->health >= 0) { int oldpieces = ASigil::GiveSigilPiece (player->mo); item = player->mo->FindInventory (RUNTIME_CLASS(ASigil)); @@ -411,6 +411,11 @@ void cht_DoCheat (player_t *player, int cheat) void GiveSpawner (player_t *player, const PClass *type, int amount) { + if (player->mo == NULL || player->health <= 0) + { + return; + } + AInventory *item = static_cast (Spawn (type, player->mo->x, player->mo->y, player->mo->z)); if (item != NULL) diff --git a/src/p_user.cpp b/src/p_user.cpp index bae6b9723..0566b7b31 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -277,9 +277,6 @@ void APlayerPawn::Tick() void APlayerPawn::AddInventory (AInventory *item) { - // Don't add to the inventory of dead players. - if (health<=0) return; - // Adding inventory to a voodoo doll should add it to the real player instead. if (player != NULL && player->mo != this) { diff --git a/wadsrc/decorate/doom/doomhealth.txt b/wadsrc/decorate/doom/doomhealth.txt index 8cd1bf326..dce00ace9 100644 --- a/wadsrc/decorate/doom/doomhealth.txt +++ b/wadsrc/decorate/doom/doomhealth.txt @@ -24,7 +24,6 @@ ACTOR Stimpack : Health 2011 Game Doom SpawnID 23 Inventory.Amount 10 - Inventory.MaxAmount 100 Inventory.PickupMessage "$GOTSTIM" States { @@ -41,7 +40,6 @@ ACTOR Medikit : Health 2012 Game Doom SpawnID 24 Inventory.Amount 25 - Inventory.MaxAmount 100 Inventory.PickupMessage "$GOTMEDIKIT" Health.LowMessage 25, "$GOTMEDINEED" States