From eb3340e8725401e162bd3938a77fd864c702c9de Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 28 Aug 2010 19:20:14 +0000 Subject: [PATCH] - fixed: Clearing a pickup message for inventory items was not possible. Changed it so that "You got a pickup" is AInventory's pickup message and not a default returned when nothing valid is set. SVN r2625 (trunk) --- src/g_shared/a_pickups.cpp | 6 ++---- wadsrc/static/actors/shared/inventory.txt | 1 + wadsrc/static/language.enu | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index 3802bd477..30dcd482c 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -890,7 +890,7 @@ void AInventory::Touch (AActor *toucher) { const char * message = PickupMessage (); - if (toucher->CheckLocalView (consoleplayer) + if (message != NULL && *message != 0 && toucher->CheckLocalView (consoleplayer) && (StaticLastMessageTic != gametic || StaticLastMessage != message)) { StaticLastMessageTic = gametic; @@ -960,9 +960,7 @@ void AInventory::DoPickupSpecial (AActor *toucher) const char *AInventory::PickupMessage () { - const char *message = GetClass()->Meta.GetMetaString (AIMETA_PickupMessage); - - return message != NULL? message : "You got a pickup"; + return GetClass()->Meta.GetMetaString (AIMETA_PickupMessage); } //=========================================================================== diff --git a/wadsrc/static/actors/shared/inventory.txt b/wadsrc/static/actors/shared/inventory.txt index a61519df0..49b6b39a2 100644 --- a/wadsrc/static/actors/shared/inventory.txt +++ b/wadsrc/static/actors/shared/inventory.txt @@ -5,6 +5,7 @@ ACTOR Inventory native Inventory.InterHubAmount 1 Inventory.UseSound "misc/invuse" Inventory.PickupSound "misc/i_pkup" + Inventory.PickupMessage "$TXT_DEFAULTPICKUPMSG" action native A_JumpIfNoAmmo(state label); action native A_CustomPunch(int damage, bool norandom = false, int flags = CPF_USEAMMO, class pufftype = "BulletPuff", float range = 0, float lifesteal = 0); diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index 6a7580fbf..58cc87049 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -286,6 +286,7 @@ STSTR_CHOPPERS = "... doesn't suck - GM"; STSTR_CLEV = "Changing Level...\n"; TXT_BUDDHAON = "Buddha mode ON"; TXT_BUDDHAOFF = "Buddha mode OFF"; +TXT_DEFAULTPICKUPMSG = "You got a pickup"; E1TEXT = "Once you beat the big badasses and\n"