This commit is contained in:
GenZmeY 2022-09-26 13:07:26 +03:00
parent 62be0d356c
commit 4ba3a69873
4 changed files with 2 additions and 93 deletions

View File

@ -1,54 +0,0 @@
class CfgLifespan extends Object
config(MSKGS)
abstract;
var public config int Weap;
var public config int Dosh;
public static function InitConfig(int Version, int LatestVersion, E_LogLevel LogLevel)
{
`Log_TraceStatic();
switch (Version)
{
case `NO_CONFIG:
ApplyDefault(LogLevel);
default: break;
}
if (LatestVersion != Version)
{
StaticSaveConfig();
}
}
public static function Load(E_LogLevel LogLevel)
{
`Log_TraceStatic();
if (default.Weap < 0)
{
`Log_Error("Weap" @ "(" $ default.Weap $ ")" @ "must be equal or greater than 0");
default.Weap = 60 * 60;
}
if (default.Dosh < 0)
{
`Log_Error("Dosh" @ "(" $ default.Dosh $ ")" @ "must be equal or greater than 0");
default.Dosh = 60 * 5;
}
}
protected static function ApplyDefault(E_LogLevel LogLevel)
{
`Log_TraceStatic();
default.Weap = 60 * 60; // 1 hour
default.Dosh = 60 * 5; // 5 min
}
defaultproperties
{
}

View File

@ -5,7 +5,6 @@ class MSKGS extends Info
const LatestVersion = 1; const LatestVersion = 1;
const CfgCredits = class'CfgCredits'; const CfgCredits = class'CfgCredits';
const CfgLifespan = class'CfgLifespan';
const CfgSpawnManager = class'CfgSpawnManager'; const CfgSpawnManager = class'CfgSpawnManager';
const CfgXPBoost = class'CfgXPBoost'; const CfgXPBoost = class'CfgXPBoost';
const CfgSrvRank = class'CfgSrvRank'; const CfgSrvRank = class'CfgSrvRank';
@ -90,7 +89,6 @@ private function PreInit()
} }
CfgCredits.static.InitConfig(Version, LatestVersion, LogLevel); CfgCredits.static.InitConfig(Version, LatestVersion, LogLevel);
CfgLifespan.static.InitConfig(Version, LatestVersion, LogLevel);
CfgSpawnManager.static.InitConfig(Version, LatestVersion, LogLevel); CfgSpawnManager.static.InitConfig(Version, LatestVersion, LogLevel);
CfgXPBoost.static.InitConfig(Version, LatestVersion, LogLevel); CfgXPBoost.static.InitConfig(Version, LatestVersion, LogLevel);
CfgSrvRank.static.InitConfig(Version, LatestVersion, LogLevel); CfgSrvRank.static.InitConfig(Version, LatestVersion, LogLevel);
@ -132,7 +130,6 @@ private function PreInit()
`Log_Base("LogLevel:" @ LogLevel); `Log_Base("LogLevel:" @ LogLevel);
CfgCredits.static.Load(LogLevel); CfgCredits.static.Load(LogLevel);
CfgLifespan.static.Load(LogLevel);
CfgSpawnManager.static.Load(LogLevel); CfgSpawnManager.static.Load(LogLevel);
CfgXPBoost.static.Load(LogLevel); CfgXPBoost.static.Load(LogLevel);
CfgSrvRank.static.Load(LogLevel); CfgSrvRank.static.Load(LogLevel);
@ -292,26 +289,6 @@ public function E_LogLevel GetLogLevel()
return LogLevel; return LogLevel;
} }
public function ModifyLifespan(Actor A)
{
`Log_Trace();
if (KFDroppedPickup_Cash(A) != None)
{
if (CfgLifespan.default.Dosh != 0)
{
A.Lifespan = float(CfgLifespan.default.Dosh);
}
}
else if (KFDroppedPickup(A) != None)
{
if (CfgLifespan.default.Weap != 0)
{
A.Lifespan = float(CfgLifespan.default.Weap);
}
}
}
public function SetMaxPlayers(int MaxPlayers) public function SetMaxPlayers(int MaxPlayers)
{ {
`Log_Trace(); `Log_Trace();

View File

@ -1,5 +1,4 @@
class MSKGS_Mut extends KFMutator class MSKGS_Mut extends KFMutator;
config(MSKGS);
var private MSKGS MSKGS; var private MSKGS MSKGS;
@ -48,19 +47,6 @@ public function AddMutator(Mutator Mut)
Super.AddMutator(Mut); Super.AddMutator(Mut);
} }
public function bool CheckRelevance(Actor A)
{
local bool Relevance;
Relevance = Super.CheckRelevance(A);
if (Relevance)
{
MSKGS.ModifyLifespan(A);
}
return Relevance;
}
public function NotifyLogin(Controller C) public function NotifyLogin(Controller C)
{ {
MSKGS.NotifyLogin(C); MSKGS.NotifyLogin(C);

2
tools

@ -1 +1 @@
Subproject commit 88b35bd7ebb7e30448579f1564220398f990541c Subproject commit a741b23415a008a6f8ab8c12c4e7ed1281c2dab0