From d36d4aa8633bdbdeefb97c34ae23d5cc15bee8d2 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 15 Jan 2008 04:57:25 +0000 Subject: [PATCH] - Fixed: ACS translations were loaded into the wrong slot after restoring a savegame. - Fixed exploit: Dropping ammo at baby and nightmare skill levels would give you back more than you dropped. SVN r706 (trunk) --- docs/rh-log.txt | 6 ++++++ src/g_level.cpp | 6 +----- src/g_shared/a_pickups.cpp | 17 +++++++++++++++++ src/g_shared/a_pickups.h | 1 + 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 7adae5b8d..9a78afff7 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,9 @@ +January 14, 2008 +- Fixed: ACS translations were loaded into the wrong slot after restoring a + savegame. +- Fixed exploit: Dropping ammo at baby and nightmare skill levels would give + you back more than you dropped. + January 13, 2008 (Changes by Graf Zahl) - Moved A_Punch from Inventory to Actor. Apparently there are WADs that use it for monsters. The function works fine for monsters as it is. diff --git a/src/g_level.cpp b/src/g_level.cpp index 38d7219c3..6db6f079c 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -2744,15 +2744,11 @@ void G_SerializeLevel (FArchive &arc, bool hubLoad) { while (arc << w, w != 0xffff) { - if (w >= MAX_ACS_TRANSLATIONS) - { // hack hack to avoid crashing - w = 0; - } trans = translationtables[TRANSLATION_LevelScripted].GetVal(w); if (trans == NULL) { trans = new FRemapTable; - translationtables[TRANSLATION_LevelScripted].SetVal(t, trans); + translationtables[TRANSLATION_LevelScripted].SetVal(w, trans); } trans->Serialize(arc); } diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index df25ea244..d5058a892 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -160,6 +160,23 @@ AInventory *AAmmo::CreateCopy (AActor *other) return copy; } +//=========================================================================== +// +// AAmmo :: CreateTossable +// +//=========================================================================== + +AInventory *AAmmo::CreateTossable() +{ + AInventory *copy = Super::CreateTossable(); + if (copy != NULL) + { // Do not increase ammo by dropping it and picking it back up at + // certain skill levels. + copy->ItemFlags |= IF_IGNORESKILL; + } + return copy; +} + //--------------------------------------------------------------------------- // // FUNC P_GiveBody diff --git a/src/g_shared/a_pickups.h b/src/g_shared/a_pickups.h index 8155b8622..3f58cfcd7 100644 --- a/src/g_shared/a_pickups.h +++ b/src/g_shared/a_pickups.h @@ -190,6 +190,7 @@ public: AInventory *CreateCopy (AActor *other); bool HandlePickup (AInventory *item); const PClass *GetParentAmmo () const; + AInventory *CreateTossable (); int BackpackAmount, BackpackMaxAmount; };