shithub: qk1

Download patch

ref: d3fd0ce3fd223f7acfdba6ea650cba84f3d2db57
parent: 3f506a05d119fed79b2663126321297458b25966
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Mon Oct 9 20:52:12 EDT 2023

qc: add "pr_checkextension", no extensions are defined (yet)

--- a/pr_cmds.c
+++ b/pr_cmds.c
@@ -1499,8 +1499,32 @@
 	PR_RunError ("unimplemented bulitin");
 }
 
+static const char *exts[] = {
+	"NEIN_QC", // yes, this is just a dummy
+};
 
+static void PF_checkextension (void)
+{
+	const char *ext = G_STRING(OFS_PARM0);
+	int i;
 
+	G_FLOAT(OFS_RETURN) = false;
+	//fprint(2, "checking extension %s\n", ext);
+	for(i = 0; i < nelem(exts); i++){
+		if(strcmp(ext, exts[i]) == 0){
+			G_FLOAT(OFS_RETURN) = true;
+			break;
+		}
+	}
+}
+
+static void PF_clientstat (void)
+{
+	// FIXME
+	// Arcane Dimensions will fall off if this one isn't defined
+	// even though it does *not* check for the extension
+}
+
 builtin_t pr_builtin[] =
 {
 PF_Fixme,
@@ -1589,7 +1613,10 @@
 PF_precache_sound,		// precache_sound2 is different only for qcc
 PF_precache_file,
 
-PF_setspawnparms
+PF_setspawnparms, // #78
+
+[99] = PF_checkextension,
+[232] = PF_clientstat,
 };
 
 builtin_t *pr_builtins = pr_builtin;
--- a/pr_edict.c
+++ b/pr_edict.c
@@ -30,6 +30,7 @@
 cvar_t	saved2 = {"saved2", "0", true};
 cvar_t	saved3 = {"saved3", "0", true};
 cvar_t	saved4 = {"saved4", "0", true};
+cvar_t	pr_checkextension = {"pr_checkextension", "1"};
 
 #define	MAX_FIELD_LEN	64
 #define GEFV_CACHESIZE	2
@@ -991,6 +992,7 @@
 	Cvar_RegisterVariable (&saved2);
 	Cvar_RegisterVariable (&saved3);
 	Cvar_RegisterVariable (&saved4);
+	Cvar_RegisterVariable (&pr_checkextension);
 }