leader: move download + precache to OnConfigsExecuted()

This commit is contained in:
neon 2018-09-06 19:20:45 +02:00
parent 6e3b10fc05
commit 09a4ea7e4e

View File

@ -173,16 +173,6 @@ public void ConVarChange(ConVar CVar, const char[] oldVal, const char[] newVal)
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
public void OnMapStart() public void OnMapStart()
{ {
AddFileToDownloadsTable(DefendVTF);
AddFileToDownloadsTable(DefendVMT);
AddFileToDownloadsTable(FollowVTF);
AddFileToDownloadsTable(FollowVMT);
PrecacheGeneric(DefendVTF, true);
PrecacheGeneric(DefendVMT, true);
PrecacheGeneric(FollowVTF, true);
PrecacheGeneric(FollowVMT, true);
Handle gameConfig = LoadGameConfigFile("funcommands.games"); Handle gameConfig = LoadGameConfigFile("funcommands.games");
if (gameConfig == null) if (gameConfig == null)
{ {
@ -203,6 +193,22 @@ public void OnMapStart()
UpdateLeaders(); UpdateLeaders();
} }
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
public void OnConfigsExecuted()
{
AddFileToDownloadsTable(DefendVTF);
AddFileToDownloadsTable(DefendVMT);
AddFileToDownloadsTable(FollowVTF);
AddFileToDownloadsTable(FollowVMT);
PrecacheGeneric(DefendVTF, true);
PrecacheGeneric(DefendVMT, true);
PrecacheGeneric(FollowVTF, true);
PrecacheGeneric(FollowVMT, true);
}
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
// Purpose: // Purpose:
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
@ -1233,4 +1239,4 @@ public Action VoteLeader(int client, int argc)
} }
return Plugin_Handled; return Plugin_Handled;
} }