From 0aee56be158a839da3ca907e7f11f28ebdbe58e5 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Mon, 30 Jul 2012 00:50:19 +0000 Subject: [PATCH] - Fixed typo in r3795's change to GetActorZ and a potential null pointer dereference. SVN r3796 (trunk) --- src/p_acs.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index a5f046d76e..8ab158d485 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -6345,10 +6345,17 @@ scriptwait: case PCD_GETACTORZ: { AActor *actor = SingleActorFromTID(STACK(1), activator); - STACK(1) = actor == NULL ? 0 : (&actor->x)[pcd - PCD_GETACTORX]; - if (pcd == PCD_GETACTORZ) + if (actor == NULL) { - pcd += actor->GetBobOffset(); + STACK(1) = 0; + } + else if (pcd == PCD_GETACTORZ) + { + STACK(1) = actor->z + actor->GetBobOffset(); + } + else + { + STACK(1) = (&actor->x)[pcd - PCD_GETACTORX]; } } break;