From 82255c4dfd0a7a8bcc92cda6958f4d951147157b Mon Sep 17 00:00:00 2001 From: John Palomo Jr Date: Sun, 19 Oct 2014 20:52:48 -0400 Subject: [PATCH] Using PickActor will only set the TID if the picked actor doesn't have a TID already. An optional 8th parameter (bool forceTID) was added to revert to the old behavior. --- src/p_acs.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index bc4cbdb758..aeb47a8075 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -5619,15 +5619,27 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound) wallMask = args[6]; } + bool forceTID = 0; + if (argCount >= 8) + { + if (args[7] != 0) + forceTID = 1; + } + AActor* pickedActor = P_LinePickActor(actor, args[1] << 16, args[3], args[2] << 16, actorMask, wallMask); if (pickedActor == NULL) { return 0; } - pickedActor->RemoveFromHash(); - pickedActor->tid = args[4]; - pickedActor->AddToHash(); - + if (!(forceTID) && (args[4] == 0) && (pickedActor->tid == 0)) + return 0; + + if ((pickedActor->tid == 0) || (forceTID)) + { + pickedActor->RemoveFromHash(); + pickedActor->tid = args[4]; + pickedActor->AddToHash(); + } return 1; } break;