From efce2a200c17e6e41d3e43d6da2a1b4e4b138452 Mon Sep 17 00:00:00 2001 From: Benjamin Moir Date: Fri, 31 Jul 2015 22:24:01 +0930 Subject: [PATCH] Added WARPF_USETID to A_Warp --- src/p_local.h | 1 + src/thingdef/thingdef_codeptr.cpp | 13 +++++++++++-- wadsrc/static/actors/constants.txt | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/p_local.h b/src/p_local.h index 691d66245..0b1c9c7a8 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -197,6 +197,7 @@ enum WARPF WARPF_BOB = 0x800, WARPF_MOVEPTR = 0x1000, WARPF_USEPTR = 0x2000, + WARPF_USETID = 0x2000, }; diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 733572a04..e47f4148f 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -4664,8 +4664,17 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Warp) ACTION_PARAM_ANGLE(angle, 4); ACTION_PARAM_INT(flags, 5); ACTION_PARAM_STATE(success_state, 6); - - AActor *reference = COPY_AAPTR(self, destination_selector); + + AActor *reference; + + if((flags & WARPF_USETID)) + { + reference = SingleActorFromTID(destination_selector, self); + } + else + { + reference = COPY_AAPTR(self, destination_selector); + } //If there is no actor to warp to, fail. if (!reference) diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index 7aa23716f..1ee6c96c9 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -357,6 +357,7 @@ Const Int WAPRF_ABSOLUTEPOSITION = 0x400; Const Int WARPF_ABSOLUTEPOSITION = 0x400; Const Int WARPF_BOB = 0x800; Const Int WARPF_MOVEPTR = 0x1000; +Const Int WARPF_USETID = 0x2000; // flags for A_SetPitch/SetAngle/SetRoll const int SPF_FORCECLAMP = 1;