DP_QC_NUM_FOR_EDICT extension implemented by Blub
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 27 Feb 2008 16:34:09 +0000 (16:34 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 27 Feb 2008 16:34:09 +0000 (16:34 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8149 d7cf8633-e32d-0410-b094-e92efae38249

clvm_cmds.c
mvm_cmds.c
prvm_cmds.c
prvm_cmds.h
svvm_cmds.c

index 415b3da..08c0e59 100644 (file)
@@ -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
index 05f50f9..91d45e2 100644 (file)
@@ -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
index 0fde718..367fe96 100644 (file)
@@ -669,6 +669,19 @@ void VM_ftoe(void)
 }
 
 /*
+========================
+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
 
index b523e84..88d0767 100644 (file)
@@ -415,3 +415,5 @@ void VM_Cmd_Reset(void);
 
 void VM_uri_escape (void);
 void VM_uri_unescape (void);
+
+void VM_etof (void);
index e2d1de3..ecdd3ef 100644 (file)
@@ -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