From f941fa9e40d7aebad38e6569bba9fa20972b0eac Mon Sep 17 00:00:00 2001 From: Braden Obrzut Date: Mon, 2 Mar 2015 17:25:35 -0500 Subject: [PATCH] - Fixed: SwapActorTeleFog didn't work with tid 0 (activator). --- src/p_acs.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index ecaecd2c9..912cdaa01 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -4815,15 +4815,11 @@ static int SwapActorTeleFog(AActor *activator, int tid) int count = 0; if (tid == 0) { - if ((activator == NULL) || (activator->TeleFogSourceType = activator->TeleFogDestType)) + if ((activator == NULL) || (activator->TeleFogSourceType == activator->TeleFogDestType)) return 0; //Does nothing if they're the same. - else - { - const PClass *temp = activator->TeleFogSourceType; - activator->TeleFogSourceType = activator->TeleFogDestType; - activator->TeleFogDestType = temp; - return 1; - } + + swapvalues (activator->TeleFogSourceType, activator->TeleFogDestType); + return 1; } else { @@ -4834,9 +4830,8 @@ static int SwapActorTeleFog(AActor *activator, int tid) { if (actor->TeleFogSourceType == actor->TeleFogDestType) continue; //They're the same. Save the effort. - const PClass *temp = actor->TeleFogSourceType; - actor->TeleFogSourceType = actor->TeleFogDestType; - actor->TeleFogDestType = temp; + + swapvalues (actor->TeleFogSourceType, actor->TeleFogDestType); count++; } }