From 5979378c4e772813a90514f2ea2a8e834e64c40b Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Sun, 26 Apr 2015 00:07:57 +0000 Subject: [PATCH] CON: Add player[].index, which returns the player ID that you put in. Mostly useful to get the magic value of THISACTOR when applied to the player struct. DONT_BUILD. git-svn-id: https://svn.eduke32.com/eduke32@5165 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/gamedef.c | 1 + polymer/eduke32/source/gamedef.h | 1 + polymer/eduke32/source/gamestructures.c | 1 + polymer/eduke32/source/lunatic/con_lang.lua | 1 + 4 files changed, 4 insertions(+) diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 1c3bdc97a..cd5f33f55 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -1012,6 +1012,7 @@ const memberlabel_t PlayerLabels[]= { "autostep", PLAYER_AUTOSTEP, 0, 0 }, { "autostep_sbw", PLAYER_AUTOSTEP_SBW, 0, 0 }, { "hudpal", PLAYER_HUDPAL, 0, 0 }, + { "index", PLAYER_INDEX, 0, 0 }, { "", -1, 0, 0 } // END OF LIST }; diff --git a/polymer/eduke32/source/gamedef.h b/polymer/eduke32/source/gamedef.h index 22d536ce6..413316b46 100644 --- a/polymer/eduke32/source/gamedef.h +++ b/polymer/eduke32/source/gamedef.h @@ -357,6 +357,7 @@ enum PlayerLabel_t PLAYER_AUTOSTEP, PLAYER_AUTOSTEP_SBW, PLAYER_HUDPAL, + PLAYER_INDEX, PLAYER_END }; diff --git a/polymer/eduke32/source/gamestructures.c b/polymer/eduke32/source/gamestructures.c index 93fbb06b4..30e8eaaa8 100644 --- a/polymer/eduke32/source/gamestructures.c +++ b/polymer/eduke32/source/gamestructures.c @@ -555,6 +555,7 @@ int32_t __fastcall VM_GetPlayer(register int32_t const iPlayer, register int32_t case PLAYER_AUTOSTEP: lLabelID = ps->autostep; break; case PLAYER_AUTOSTEP_SBW: lLabelID = ps->autostep_sbw; break; case PLAYER_HUDPAL: lLabelID = P_GetHudPal(ps); break; + case PLAYER_INDEX: lLabelID = iPlayer; break; default: lLabelID = -1; break; } diff --git a/polymer/eduke32/source/lunatic/con_lang.lua b/polymer/eduke32/source/lunatic/con_lang.lua index f1bff7180..997497717 100644 --- a/polymer/eduke32/source/lunatic/con_lang.lua +++ b/polymer/eduke32/source/lunatic/con_lang.lua @@ -577,6 +577,7 @@ local PlayerLabels = { on_crane = PL".on_crane", i = { PL".i" }, + index = { "%s" }, one_parallax_sectnum = DISABLED{ PL".one_parallax_sectnum" },