]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add cvars for the custom rifle balance in riflearena mode
authorMario <mario.mario@y7mail.com>
Tue, 28 May 2013 06:24:00 +0000 (16:24 +1000)
committerMario <mario.mario@y7mail.com>
Tue, 28 May 2013 06:24:00 +0000 (16:24 +1000)
defaultXonotic.cfg
qcsrc/server/mutators/mutator_riflearena.qc

index 533e2546cc538ec103f85150de150f41458f7101..09e3d18527611439296e59692cc4058203f5e857 100644 (file)
@@ -1613,3 +1613,8 @@ set g_riflearena_nade_newton_style 0
 set g_riflearena_nade_minforce 400
 set g_riflearena_nade_maxforce 2000
 set g_riflearena_nade_refire 6
+set g_riflearena_rifle_secondary_spread 0
+set g_riflearena_rifle_secondary_shots 1
+set g_riflearena_rifle_secondary_animtime 0.15
+set g_riflearena_rifle_secondary_refire 0.15
+set g_riflearena_rifle_secondary_damage 40
index 7ad0ff6cb211292ebfb89c7cf7d77925b1920f9b..540f70d35bb079c79adfe6b5567a44b49c523b2c 100644 (file)
@@ -188,6 +188,15 @@ void ra_nade_prime()
        self.ra_nade.projectiledeathtype = DEATH_NADE_NORMAL;
 }
 
+void ra_SetCvars()
+{
+       cvar_settemp("g_balance_rifle_secondary_spread", ftos(cvar("g_riflearena_rifle_secondary_spread")));
+       cvar_settemp("g_balance_rifle_secondary_shots", ftos(cvar("g_riflearena_rifle_secondary_shots")));
+       cvar_settemp("g_balance_rifle_secondary_animtime", ftos(cvar("g_riflearena_rifle_secondary_animtime")));
+       cvar_settemp("g_balance_rifle_secondary_refire", ftos(cvar("g_riflearena_rifle_secondary_refire")));
+       cvar_settemp("g_balance_rifle_secondary_damage", ftos(cvar("g_riflearena_rifle_secondary_damage")));
+}
+
 MUTATOR_HOOKFUNCTION(ra_VehicleEnter)
 {
        if(other.ra_nade)
@@ -363,11 +372,8 @@ MUTATOR_DEFINITION(mutator_riflearena)
        
        MUTATOR_ONADD
        {
-               cvar_settemp("g_balance_rifle_secondary_spread", "0");
-               cvar_settemp("g_balance_rifle_secondary_shots", "1");
-               cvar_settemp("g_balance_rifle_secondary_animtime", "0.15");
-               cvar_settemp("g_balance_rifle_secondary_refire", "0.15");
-               cvar_settemp("g_balance_rifle_secondary_damage", "40");
+               ra_SetCvars();
+               
                precache_model("models/ok_nade_counter/ok_nade_counter.md3");
                
                precache_model("models/weapons/h_ok_grenade.iqm");