]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
mark Sandbox as mod for the server browser
authorRudolf Polzer <divverent@xonotic.org>
Sun, 19 Feb 2012 16:22:58 +0000 (17:22 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Sun, 19 Feb 2012 16:22:58 +0000 (17:22 +0100)
qcsrc/server/g_world.qc
qcsrc/server/mutators/base.qh
qcsrc/server/mutators/sandbox.qc

index acf820803c36d502299e43659e78da0574565ac4..bd49365a625fd8588642fa9c93826fbd06f04dac 100644 (file)
@@ -909,13 +909,8 @@ void spawnfunc_worldspawn (void)
 
        PlayerStats_Init();
 
+       // MOD AUTHORS: change this, and possibly remove a few of the blocks below to ignore certain changes
        modname = "Xonotic";
-       // weird mutators that deserve to count as mod
-       if(autocvar_g_minstagib)
-               modname = "MinstaGib";
-       // weird game types that deserve to count as mod
-       if(g_cts)
-               modname = "CTS";
        // physics/balance/config changes that count as mod
        if(cvar_string("g_mod_physics") != cvar_defstring("g_mod_physics"))
                modname = cvar_string("g_mod_physics");
@@ -923,8 +918,19 @@ void spawnfunc_worldspawn (void)
                modname = cvar_string("g_mod_balance");
        if(cvar_string("g_mod_config") != cvar_defstring("g_mod_config"))
                modname = cvar_string("g_mod_config");
+       // weird mutators that deserve to count as mod
+       if(autocvar_g_minstagib)
+               modname = "MinstaGib";
+       // extra mutators that deserve to count as mod
+       MUTATOR_CALLHOOK(SetModname);
+       // weird game types that deserve to count as mod
+       if(g_cts)
+               modname = "CTS";
+       // save it for later
        modname = strzone(modname);
 
+       WinningConditionHelper(); // set worldstatus
+
        world_initialized = 1;
 }
 
index ecec3c87c57a65c107afb09d2b02cf457526d744..137eebadb87edc1e56719e1e4be70dc6ce93fad0 100644 (file)
@@ -201,3 +201,7 @@ MUTATOR_HOOKABLE(Spawn_Score);
 
 MUTATOR_HOOKABLE(SV_StartFrame);
        // runs globally each server frame
+
+MUTATOR_HOOKABLE(SetModname);
+       // OUT
+       string modname; // name of the mutator/mod if it warrants showing as such in the server browser
index e7f51aa887f7931445f0006452db6110a7e8928f..31a1a4e8546d7256018798902e5da0d174bbdec8 100644 (file)
@@ -794,10 +794,17 @@ MUTATOR_HOOKFUNCTION(sandbox_StartFrame)
        return TRUE;
 }
 
+MUTATOR_HOOKFUNCTION(sandbox_SetModname)
+{
+       modname = "Sandbox";
+       return TRUE;
+}
+
 MUTATOR_DEFINITION(sandbox)
 {
        MUTATOR_HOOK(SV_ParseClientCommand, sandbox_PlayerCommand, CBC_ORDER_ANY);
        MUTATOR_HOOK(SV_StartFrame, sandbox_StartFrame, CBC_ORDER_ANY);
+       MUTATOR_HOOK(SetModname, sandbox_SetModname, CBC_ORDER_ANY);
 
        MUTATOR_ONADD
        {