shithub: qk1

Download patch

ref: 2753cf990df25e4fa0799719d324dabe5bb95a8a
parent: 61a668a6c7d98d157c6e6fcf8149aba332a80587
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Thu Dec 28 19:35:26 EST 2023

cvar: call the callback if set through setcvar()

--- a/cvar.c
+++ b/cvar.c
@@ -130,9 +130,7 @@
 		return true;
 	}
 
-	setcvar (v->name, Cmd_Argv(1));
-	if(v->cb != nil)
-		v->cb(v);
+	setcvar(v->name, Cmd_Argv(1));
 	return true;
 }
 
@@ -154,6 +152,8 @@
 	cv->value = atof(v);
 	if(n && cv->server && sv.active)
 		SV_BroadcastPrintf("\"%s\" changed to \"%s\"\n", cv->name, cv->string);
+	if(cv->cb != nil)
+		cv->cb(cv);
 }
 
 void