From 106cf82f6262e0d930bf07e079fd4c8243d05eb9 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 15 Sep 2010 21:41:49 +0000 Subject: [PATCH] - added a fixed version of Demolisher's GetActor** submission for returning the activator's info when the tid is 0. SVN r2787 (trunk) --- src/p_acs.cpp | 84 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 59 insertions(+), 25 deletions(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 807827b95..ff7a95625 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -5834,15 +5834,22 @@ int DLevelScript::RunScript () case PCD_GETACTORY: case PCD_GETACTORZ: { - AActor *actor = SingleActorFromTID (STACK(1), activator); - - if (actor == NULL) + if(STACK(1) == 0) { - STACK(1) = 0; + STACK(1) = (&activator->x)[pcd - PCD_GETACTORX]; } else { - STACK(1) = (&actor->x)[pcd - PCD_GETACTORX]; + AActor *actor = SingleActorFromTID (STACK(1), activator); + + if (actor == NULL) + { + STACK(1) = 0; + } + else + { + STACK(1) = (&actor->x)[pcd - PCD_GETACTORX]; + } } } break; @@ -5850,50 +5857,77 @@ int DLevelScript::RunScript () case PCD_GETACTORFLOORZ: case PCD_GETACTORCEILINGZ: { - AActor *actor = SingleActorFromTID (STACK(1), activator); - - if (actor == NULL) + if(STACK(1) == 0) { - STACK(1) = 0; - } - else if (pcd == PCD_GETACTORFLOORZ) - { - STACK(1) = actor->floorz; + if (pcd == PCD_GETACTORFLOORZ) + { + STACK(1) = activator->floorz; + } + else if(STACK(1) == 0) + { + STACK(1) = activator->ceilingz; + } } else { - STACK(1) = actor->ceilingz; - } + AActor *actor = SingleActorFromTID (STACK(1), activator); + if (actor == NULL) + { + STACK(1) = 0; + } + else if (pcd == PCD_GETACTORFLOORZ) + { + STACK(1) = actor->floorz; + } + else + { + STACK(1) = actor->ceilingz; + } + } } break; case PCD_GETACTORANGLE: { - AActor *actor = SingleActorFromTID (STACK(1), activator); - - if (actor == NULL) + if(STACK(1) == 0) { - STACK(1) = 0; + STACK(1) = activator->angle >> 16; } else { - STACK(1) = actor->angle >> 16; + AActor *actor = SingleActorFromTID (STACK(1), activator); + + if (actor == NULL) + { + STACK(1) = 0; + } + else + { + STACK(1) = actor->angle >> 16; + } } } break; case PCD_GETACTORPITCH: { - AActor *actor = SingleActorFromTID (STACK(1), activator); - - if (actor == NULL) + if(STACK(1) == 0) { - STACK(1) = 0; + STACK(1) = activator->pitch >> 16; } else { - STACK(1) = actor->pitch >> 16; + AActor *actor = SingleActorFromTID (STACK(1), activator); + + if (actor == NULL) + { + STACK(1) = 0; + } + else + { + STACK(1) = actor->pitch >> 16; + } } } break;