From 4b9d0c6dfffe877d38da0b882013be4dcffc03e7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 7 Jun 2009 22:13:16 +0000 Subject: [PATCH] - added parameter to A_FadeOut so that removing the actor can be made an option. SVN r1652 (trunk) --- docs/rh-log.txt | 1 + src/thingdef/thingdef_codeptr.cpp | 7 ++++--- wadsrc/static/actors/actor.txt | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index f837255ce..690ece343 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,5 @@ June 7, 2009 (Changes by Graf Zahl) +- added parameter to A_FadeOut so that removing the actor can be made an option. - added PERSISTENTPOWER and TRANSFERPOINTERS submissions by Gez. - fixed FORCEPAIN logic. - added Gez's infinite ammo powerup and random spawner fix patches. diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 4a5c3f3b7..873a01bfc 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -1705,14 +1705,15 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FadeIn) //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FadeOut) { - ACTION_PARAM_START(1); + ACTION_PARAM_START(2); ACTION_PARAM_FIXED(reduce, 0); - + ACTION_PARAM_BOOL(remove, 1); + if (reduce == 0) reduce = FRACUNIT/10; self->RenderStyle.Flags &= ~STYLEF_Alpha1; self->alpha -= reduce; - if (self->alpha<=0) self->Destroy(); + if (self->alpha<=0 && remove) self->Destroy(); } //=========================================================================== diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index 907c1d618..67518e6a1 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -184,7 +184,7 @@ ACTOR Actor native //: Thinker action native A_Print(string whattoprint, float time = 0, string fontname = ""); action native A_SetTranslucent(float alpha, int style = 0); action native A_FadeIn(float reduce = 0.1); - action native A_FadeOut(float reduce = 0.1); + action native A_FadeOut(float reduce = 0.1, bool remove = true); action native A_SpawnDebris(class spawntype, bool transfer_translation = false, float mult_h = 1, float mult_v = 1); action native A_CheckSight(state label); action native A_ExtChase(bool usemelee, bool usemissile, bool playactive = true, bool nightmarefast = false);