From 09a4ea7e4e62c6ad2603a88dbb9f8c72252cd55a Mon Sep 17 00:00:00 2001 From: neon <> Date: Thu, 6 Sep 2018 19:20:45 +0200 Subject: [PATCH] leader: move download + precache to OnConfigsExecuted() --- Leader2/scripting/Leader2.sp | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/Leader2/scripting/Leader2.sp b/Leader2/scripting/Leader2.sp index 71d26a7..86a4011 100644 --- a/Leader2/scripting/Leader2.sp +++ b/Leader2/scripting/Leader2.sp @@ -173,16 +173,6 @@ public void ConVarChange(ConVar CVar, const char[] oldVal, const char[] newVal) //---------------------------------------------------------------------------------------------------- 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"); if (gameConfig == null) { @@ -203,6 +193,22 @@ public void OnMapStart() 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: //---------------------------------------------------------------------------------------------------- @@ -1233,4 +1239,4 @@ public Action VoteLeader(int client, int argc) } return Plugin_Handled; -} +} \ No newline at end of file