From e2ce20a445ba87c4fb4e4f7bcc60c363790794aa Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 13 Jun 2010 10:38:38 +0000 Subject: [PATCH] - fixed: A_Print and related functions should not make a use state chain succeed. - fixed: APowerIronFeet must continuously reset the player's air supply. SVN r2370 (trunk) --- src/g_shared/a_artifacts.cpp | 19 +++++++++++++++---- src/g_shared/a_artifacts.h | 1 + src/thingdef/thingdef_codeptr.cpp | 4 ++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/g_shared/a_artifacts.cpp b/src/g_shared/a_artifacts.cpp index 304c9059eb..088e480c52 100644 --- a/src/g_shared/a_artifacts.cpp +++ b/src/g_shared/a_artifacts.cpp @@ -750,10 +750,6 @@ void APowerIronFeet::AbsorbDamage (int damage, FName damageType, int &newdamage) if (damageType == NAME_Drowning) { newdamage = 0; - if (Owner->player != NULL) - { - Owner->player->mo->ResetAirSupply (); - } } else if (Inventory != NULL) { @@ -761,6 +757,21 @@ void APowerIronFeet::AbsorbDamage (int damage, FName damageType, int &newdamage) } } +//=========================================================================== +// +// APowerIronFeet :: DoEffect +// +//=========================================================================== + +void APowerIronFeet::DoEffect () +{ + if (Owner->player != NULL) + { + Owner->player->mo->ResetAirSupply (); + } +} + + // Strife Environment Suit Powerup ------------------------------------------- IMPLEMENT_CLASS (APowerMask) diff --git a/src/g_shared/a_artifacts.h b/src/g_shared/a_artifacts.h index 00e39247eb..13ff0f1d40 100644 --- a/src/g_shared/a_artifacts.h +++ b/src/g_shared/a_artifacts.h @@ -86,6 +86,7 @@ class APowerIronFeet : public APowerup DECLARE_CLASS (APowerIronFeet, APowerup) public: void AbsorbDamage (int damage, FName damageType, int &newdamage); + void DoEffect (); }; class APowerMask : public APowerIronFeet diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index df1a9c23ea..c76c5842d9 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -1805,6 +1805,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Print) C_MidPrint(font != NULL ? font : SmallFont, formatted.GetChars()); con_midtime = saved; } + ACTION_SET_RESULT(false); // Prints should never set the result for inventory state chains! } //=========================================================================== @@ -1835,6 +1836,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PrintBold) FString formatted = strbin1(text); C_MidPrintBold(font != NULL ? font : SmallFont, formatted.GetChars()); con_midtime = saved; + ACTION_SET_RESULT(false); // Prints should never set the result for inventory state chains! } //=========================================================================== @@ -1848,6 +1850,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Log) ACTION_PARAM_START(1); ACTION_PARAM_STRING(text, 0); Printf("%s\n", text); + ACTION_SET_RESULT(false); // Prints should never set the result for inventory state chains! } //=========================================================================== @@ -1861,6 +1864,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_LogInt) ACTION_PARAM_START(1); ACTION_PARAM_INT(num, 0); Printf("%d\n", num); + ACTION_SET_RESULT(false); // Prints should never set the result for inventory state chains! } //===========================================================================