From 25cb3593ce50c7731c5e2b50d7b4f8b2e43861d1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 10 Aug 2010 18:30:18 +0000 Subject: [PATCH] - Added GetPolyobjX and GetPolyobjY ACS functions. SVN r2502 (trunk) --- src/p_acs.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index fc1c5f0fc..9dddbcf7c 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -70,6 +70,7 @@ #include "cmdlib.h" #include "m_png.h" #include "p_setup.h" +#include "po_man.h" #include "g_shared/a_pickups.h" @@ -3030,6 +3031,8 @@ enum EACSFunctions ACSF_SoundSequenceOnActor, ACSF_SoundSequenceOnSector, ACSF_SoundSequenceOnPolyobj, + ACSF_GetPolyobjX, + ACSF_GetPolyobjY, }; int DLevelScript::SideFromID(int id, int side) @@ -3433,6 +3436,26 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args) } break; + case ACSF_GetPolyobjX: + { + FPolyObj *poly = PO_GetPolyobj(args[0]); + if (poly != NULL) + { + return poly->StartSpot.x; + } + } + return FIXED_MAX; + + case ACSF_GetPolyobjY: + { + FPolyObj *poly = PO_GetPolyobj(args[0]); + if (poly != NULL) + { + return poly->StartSpot.y; + } + } + return FIXED_MAX; + default: break; }