From 048ee278092341c25032d5b54f4c23bd6daeeacd Mon Sep 17 00:00:00 2001 From: motorsep Date: Thu, 6 Aug 2015 02:34:11 +0000 Subject: [PATCH] + Added support for Doom 3 entity spawnargs ("name" and "target0") to allow smoother mapping experience using DarkRadiant level editor git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12222 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=4b76be9d141e54c79b4b1c2c2b22678757b2bbdf --- progdefs.h | 4 ++++ prvm_edict.c | 13 ++++++++++++- prvm_offsets.h | 4 ++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/progdefs.h b/progdefs.h index 7086dbdc..cc1f45bf 100644 --- a/progdefs.h +++ b/progdefs.h @@ -150,6 +150,10 @@ typedef struct entvars_s float spawnflags; string_t target; string_t targetname; + // motorsep 08/05/2015; support for Doom 3 entity spawnargs (whem mapping in DarkRadiant) + string_t target0; + string_t name; + // motorsep ends float dmg_take; float dmg_save; int dmg_inflictor; diff --git a/prvm_edict.c b/prvm_edict.c index bc6c5ad5..c66d3f1e 100644 --- a/prvm_edict.c +++ b/prvm_edict.c @@ -3257,11 +3257,16 @@ static qboolean PRVM_IsEdictReferenced(prvm_prog_t *prog, prvm_edict_t *edict, i { int i, j; int edictnum = PRVM_NUM_FOR_EDICT(edict); - const char *targetname = NULL; + const char *targetname = NULL; if (prog == SVVM_prog) targetname = PRVM_GetString(prog, PRVM_serveredictstring(edict, targetname)); + // motorsep 08/05/2015; support for Doom 3 entity spawnargs (whem mapping in DarkRadiant) + if(!targetname) + targetname = PRVM_GetString( prog, PRVM_serveredictstring( edict, name ) ); + // motorsep ends + if(targetname) if(!*targetname) // "" targetname = NULL; @@ -3288,6 +3293,12 @@ static qboolean PRVM_IsEdictReferenced(prvm_prog_t *prog, prvm_edict_t *edict, i if(targetname) { const char *target = PRVM_GetString(prog, PRVM_serveredictstring(ed, target)); + + // motorsep 08/05/2015; support for Doom 3 entity spawnargs (whem mapping in DarkRadiant) + if(!target) + target = PRVM_GetString( prog, PRVM_serveredictstring( ed, target0 ) ); + // motorsep ends + if(target) if(!strcmp(target, targetname)) return true; diff --git a/prvm_offsets.h b/prvm_offsets.h index 1563a051..7fd8d05b 100644 --- a/prvm_offsets.h +++ b/prvm_offsets.h @@ -376,6 +376,10 @@ PRVM_DECLARE_field(tag_index) PRVM_DECLARE_field(takedamage) PRVM_DECLARE_field(target) PRVM_DECLARE_field(targetname) +// motorsep 08/05/2015; support for Doom 3 entity spawnargs (whem mapping in DarkRadiant) +PRVM_DECLARE_field(target0) +PRVM_DECLARE_field(name) +// motorsep ends PRVM_DECLARE_field(team) PRVM_DECLARE_field(teleport_time) PRVM_DECLARE_field(think) -- 2.39.2