leader: fix bug!

This commit is contained in:
neon 2018-09-06 19:18:22 +02:00
parent 4e1242554c
commit 96c33fb0eb

View File

@ -131,7 +131,7 @@ public void OnPluginStart()
AddMultiTargetFilter("@!leaders", Filter_NotLeaders, "Everyone but Possible Leaders", false);
AddMultiTargetFilter("@leader", Filter_Leader, "Current Leader", false);
AddMultiTargetFilter("@!leader", Filter_NotLeader, "Every one but the Current Leader", false);
}
//----------------------------------------------------------------------------------------------------
@ -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:
//----------------------------------------------------------------------------------------------------
@ -616,7 +622,7 @@ public bool Filter_Leaders(const char[] sPattern, Handle hClients)
{
for(int i = 1; i <= MaxClients; i++)
{
if(IsClientInGame(i) && !IsFakeClient(i) && (IsPossibleLeader(i) || i == leaderClient))
if(IsClientInGame(i) && !IsFakeClient(i) && (IsPossibleLeader(i) || i == leaderClient))
{
PushArrayCell(hClients, i);
}
@ -646,7 +652,7 @@ public bool Filter_Leader(const char[] sPattern, Handle hClients)
{
if(IsValidClient(leaderClient))
{
PushArrayCell(hClients, leaderClient);
PushArrayCell(hClients, leaderClient);
}
return true;
}
@ -662,7 +668,7 @@ public bool Filter_NotLeader(const char[] sPattern, Handle hClients)
{
PushArrayCell(hClients, i);
}
}
}
return true;
}