]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
no
authorJakob MG <tzork@xonotic.org>
Tue, 20 Jan 2015 02:51:01 +0000 (03:51 +0100)
committerJakob MG <tzork@xonotic.org>
Tue, 20 Jan 2015 02:51:01 +0000 (03:51 +0100)
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/mutator_overkill.qc

index e6fda399e27eb0427e90a241964f623843a54feb..4f20597348b4a2c5e1ac7d67e131a5e8f6bc8868 100644 (file)
@@ -632,7 +632,7 @@ float warmup_start_health;
 float warmup_start_armorvalue;
 float g_weapon_stay;
 
-float want_weapon(entity weaponinfo, float allguns) // WEAPONTODO: what still needs done? 
+float want_weapon(entity weaponinfo, float allguns) // WEAPONTODO: what still needs done?
 {
        var float i = weaponinfo.weapon;
        var float d = 0;
@@ -2373,3 +2373,25 @@ float isPushable(entity e)
                return TRUE;
        return FALSE;
 }
+
+float LoadConfig(string FileName, int AsTemp)
+{
+               string s;
+               float fh = fopen(FileName, FILE_READ);
+               if(fh >= 0)
+               {
+                       while((s = fgets(fh)))
+                       {
+                               tokenize_console(s);
+                               if not(argv(0) == "" || argv(1) == "//" || argv(1) == "")
+                                       if(AsTemp)
+                        cvar_settemp(argv(0), argv(1));
+                    else
+                        cvar_set(argv(0), argv(1));
+                       }
+                       fclose(fh);
+            return 0;
+               }
+               else
+                       return 1;
+}
index 22cd79cff3f537a6eb1c367c750a7cb7e3e46b48..d3710712db84f0dd9168741233246d4cb968ea98 100644 (file)
@@ -97,7 +97,7 @@ MUTATOR_HOOKFUNCTION(ok_PlayerRegen)
        {
                self.armorvalue = CalcRotRegen(self.armorvalue, autocvar_g_balance_armor_regenstable, autocvar_g_balance_armor_regen, autocvar_g_balance_armor_regenlinear, 1 * frametime * (time > self.ok_pauseregen_finished), 0, 0, 1, 1 * frametime * (time > self.pauserotarmor_finished), autocvar_g_balance_armor_limit);
                self.health = CalcRotRegen(self.health, autocvar_g_balance_health_regenstable, 0, 100, 1 * frametime * (time > self.ok_pauseregen_finished), 200, 0, autocvar_g_balance_health_rotlinear, 1 * frametime * (time > self.pauserothealth_finished), autocvar_g_balance_health_limit);
-               
+
                float minf, maxf, limitf;
 
                maxf = autocvar_g_balance_fuel_rotstable;
@@ -136,7 +136,7 @@ MUTATOR_HOOKFUNCTION(ok_PlayerPreThink)
        {
                self.jump_interval = time + WEP_CVAR_PRI(blaster, refire) * W_WeaponRateFactor();
                makevectors(self.v_angle);
-               
+
                W_Blaster_Attack(
                        WEP_BLASTER | HITTYPE_SECONDARY,
                        WEP_CVAR_SEC(vaporizer, shotangle),
@@ -189,7 +189,7 @@ MUTATOR_HOOKFUNCTION(ok_PlayerSpawn)
        }
        else
                self.ok_use_ammocharge = 0;
-               
+
        self.ok_pauseregen_finished = time + 2;
 
        return FALSE;
@@ -352,6 +352,7 @@ MUTATOR_DEFINITION(mutator_overkill)
        MUTATOR_ONADD
        {
                ok_Initialize();
+               LoadConfig("overkill.cfg", TRUE);
        }
 
        MUTATOR_ONREMOVE