From 72ab301336e6bd3c6321b30fb53f410a031b41db Mon Sep 17 00:00:00 2001 From: Jakob MG Date: Tue, 20 Jan 2015 03:51:01 +0100 Subject: [PATCH] no --- qcsrc/server/miscfunctions.qc | 24 ++++++++++++++++++++++- qcsrc/server/mutators/mutator_overkill.qc | 7 ++++--- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index e6fda399e..4f2059734 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -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; +} diff --git a/qcsrc/server/mutators/mutator_overkill.qc b/qcsrc/server/mutators/mutator_overkill.qc index 22cd79cff..d3710712d 100644 --- a/qcsrc/server/mutators/mutator_overkill.qc +++ b/qcsrc/server/mutators/mutator_overkill.qc @@ -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 -- 2.39.2