From 4d59190446c60aed6ed37394d9b06d0a3ac86a47 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 31 Mar 2015 09:24:16 +0200 Subject: [PATCH] - redit commit 5f56fb5a16156a0e227ae9263eedba67141d0a51 without altering the line endings throughout thingdef_codeptr.cpp. * Changed the behavior of SetActorTeleFog. - Don't force "null" to resolve to no actor since "none" is already defined as NULL (via FindClass). (This change also applies to the decorate properties.) - Passing an empty actor name will keep the existing fog since there's otherwise no way set only one fog. Since "none" works to remove the fog, I see no reason not to have this option. --- src/thingdef/thingdef_codeptr.cpp | 26 +++++--------------------- wadsrc/static/actors/actor.txt | 2 +- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index f6e3425bc..cb59f8a1f 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -5726,33 +5726,17 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Remove) // A_SetTeleFog // // Sets the teleport fog(s) for the calling actor. -// Takes a name of the classes for te source and destination. -// Can set both at the same time. Use "" to retain the previous fog without -// changing it. +// Takes a name of the classes for the source and destination. //=========================================================================== DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetTeleFog) { ACTION_PARAM_START(2); - ACTION_PARAM_NAME(oldpos, 0); - ACTION_PARAM_NAME(newpos, 1); - const PClass *check = PClass::FindClass(oldpos); - if (check == NULL || !stricmp(oldpos, "none") || !stricmp(oldpos, "null")) - self->TeleFogSourceType = NULL; - else if (!stricmp(oldpos, "")) - { //Don't change it if it's just "" - } - else - self->TeleFogSourceType = check; + ACTION_PARAM_CLASS(oldpos, 0); + ACTION_PARAM_CLASS(newpos, 1); - check = PClass::FindClass(newpos); - if (check == NULL || !stricmp(newpos, "none") || !stricmp(newpos, "null")) - self->TeleFogDestType = NULL; - else if (!stricmp(newpos, "")) - { //Don't change it if it's just "" - } - else - self->TeleFogDestType = check; + self->TeleFogSourceType = oldpos; + self->TeleFogDestType = newpos; } //=========================================================================== diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index f84151d18..d85717ead 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -325,7 +325,7 @@ ACTOR Actor native //: Thinker action native A_GiveToSiblings(class itemtype, int amount = 0); action native A_TakeFromChildren(class itemtype, int amount = 0); action native A_TakeFromSiblings(class itemtype, int amount = 0); - action native A_SetTeleFog(name oldpos, name newpos); + action native A_SetTeleFog(class oldpos, class newpos); action native A_SwapTeleFog(); action native A_SetFloatBobPhase(int bob); action native A_SetHealth(int health, int ptr = AAPTR_DEFAULT);