From: havoc Date: Wed, 27 Feb 2008 16:34:09 +0000 (+0000) Subject: DP_QC_NUM_FOR_EDICT extension implemented by Blub X-Git-Tag: xonotic-v0.1.0preview~2373 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5e4f91bf1f9071a621cb7565d9b48f1c88bc7657;p=xonotic%2Fdarkplaces.git DP_QC_NUM_FOR_EDICT extension implemented by Blub git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8149 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/clvm_cmds.c b/clvm_cmds.c index 415b3dae..08c0e59f 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -3375,7 +3375,7 @@ NULL, // #508 NULL, // #509 VM_uri_escape, // #510 string(string in) uri_escape = #510; VM_uri_unescape, // #511 string(string in) uri_unescape = #511; -NULL, // #512 +VM_etof, // #512 float(entity ent) num_for_edict = #512 (DP_QC_NUM_FOR_EDICT) NULL, // #513 NULL, // #514 NULL, // #515 diff --git a/mvm_cmds.c b/mvm_cmds.c index 05f50f9b..91d45e2d 100644 --- a/mvm_cmds.c +++ b/mvm_cmds.c @@ -1300,7 +1300,7 @@ NULL, // #508 NULL, // #509 VM_uri_escape, // #510 string(string in) uri_escape = #510; VM_uri_unescape, // #511 string(string in) uri_unescape = #511; -NULL, // #512 +VM_etof, // #512 float(entity ent) num_for_edict = #512 (DP_QC_NUM_FOR_EDICT) NULL, // #513 NULL, // #514 NULL, // #515 diff --git a/prvm_cmds.c b/prvm_cmds.c index 0fde7181..367fe96b 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -668,6 +668,19 @@ void VM_ftoe(void) PRVM_G_INT(OFS_RETURN) = ent; } +/* +======================== +VM_etof + +float etof(entity ent) +======================== +*/ +void VM_etof(void) +{ + VM_SAFEPARMCOUNT(1, VM_etof); + PRVM_G_FLOAT(OFS_RETURN) = PRVM_G_EDICTNUM(OFS_PARM0); +} + /* ========= VM_strftime diff --git a/prvm_cmds.h b/prvm_cmds.h index b523e84f..88d0767c 100644 --- a/prvm_cmds.h +++ b/prvm_cmds.h @@ -415,3 +415,5 @@ void VM_Cmd_Reset(void); void VM_uri_escape (void); void VM_uri_unescape (void); + +void VM_etof (void); diff --git a/svvm_cmds.c b/svvm_cmds.c index e2d1de3b..ecdd3ef4 100644 --- a/svvm_cmds.c +++ b/svvm_cmds.c @@ -154,6 +154,7 @@ char *vm_sv_extensions = "DP_GECKO_SUPPORT " "DP_QC_GETSURFACEPOINTATTRIBUTE " "DP_QC_URI_ESCAPE " +"DP_QC_NUM_FOR_EDICT " ; /* @@ -3362,7 +3363,7 @@ NULL, // #508 NULL, // #509 VM_uri_escape, // #510 string(string in) uri_escape = #510; VM_uri_unescape, // #511 string(string in) uri_unescape = #511; -NULL, // #512 +VM_etof, // #512 float(entity ent) num_for_edict = #512 (DP_QC_NUM_FOR_EDICT) NULL, // #513 NULL, // #514 NULL, // #515