- redit commit 5f56fb5a16 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.
This commit is contained in:
Christoph Oelckers 2015-03-31 09:24:16 +02:00
parent 5f56fb5a16
commit 4d59190446
2 changed files with 6 additions and 22 deletions

View file

@ -5726,33 +5726,17 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Remove)
// A_SetTeleFog // A_SetTeleFog
// //
// Sets the teleport fog(s) for the calling actor. // Sets the teleport fog(s) for the calling actor.
// Takes a name of the classes for te source and destination. // Takes a name of the classes for the source and destination.
// Can set both at the same time. Use "" to retain the previous fog without
// changing it.
//=========================================================================== //===========================================================================
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetTeleFog) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetTeleFog)
{ {
ACTION_PARAM_START(2); ACTION_PARAM_START(2);
ACTION_PARAM_NAME(oldpos, 0); ACTION_PARAM_CLASS(oldpos, 0);
ACTION_PARAM_NAME(newpos, 1); ACTION_PARAM_CLASS(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;
check = PClass::FindClass(newpos); self->TeleFogSourceType = oldpos;
if (check == NULL || !stricmp(newpos, "none") || !stricmp(newpos, "null")) self->TeleFogDestType = newpos;
self->TeleFogDestType = NULL;
else if (!stricmp(newpos, ""))
{ //Don't change it if it's just ""
}
else
self->TeleFogDestType = check;
} }
//=========================================================================== //===========================================================================

View file

@ -325,7 +325,7 @@ ACTOR Actor native //: Thinker
action native A_GiveToSiblings(class<Inventory> itemtype, int amount = 0); action native A_GiveToSiblings(class<Inventory> itemtype, int amount = 0);
action native A_TakeFromChildren(class<Inventory> itemtype, int amount = 0); action native A_TakeFromChildren(class<Inventory> itemtype, int amount = 0);
action native A_TakeFromSiblings(class<Inventory> itemtype, int amount = 0); action native A_TakeFromSiblings(class<Inventory> itemtype, int amount = 0);
action native A_SetTeleFog(name oldpos, name newpos); action native A_SetTeleFog(class<TeleportFog> oldpos, class<TeleportFog> newpos);
action native A_SwapTeleFog(); action native A_SwapTeleFog();
action native A_SetFloatBobPhase(int bob); action native A_SetFloatBobPhase(int bob);
action native A_SetHealth(int health, int ptr = AAPTR_DEFAULT); action native A_SetHealth(int health, int ptr = AAPTR_DEFAULT);