forked from UNLOZE/sm-plugins
redid mapchooser so internal restrictions active in most cases respect map cooldowns. redid forum intergration with syntax compatible with 1.11 sourcemod. also added feature to it that during low pop people can get free vip
This commit is contained in:
@@ -555,10 +555,13 @@ public void OnMapStart()
|
||||
g_Config.Rewind();
|
||||
//this does not detect obvioulsy when there is more or less than 15 players active because its the mapstart
|
||||
// nobody has connected yet. OnMapEnd also does not work for checking this. so no point setting it to false here.
|
||||
/*
|
||||
if(InternalAreRestrictionsActive(true))
|
||||
g_SaveCDOnMapEnd = true;
|
||||
else
|
||||
g_SaveCDOnMapEnd = false;
|
||||
*/
|
||||
g_SaveCDOnMapEnd = true;
|
||||
}
|
||||
|
||||
public void OnConfigsExecuted()
|
||||
@@ -732,10 +735,13 @@ public Action Command_SetNextmap(int client, int args)
|
||||
g_MapVoteCompleted = true;
|
||||
//checking on MapStart and MapEnd is not good enough. Players are not considered alive and on teams at those points in time.
|
||||
//therefore instead applying the bool here after the mapvote completed.
|
||||
/*
|
||||
if(InternalAreRestrictionsActive(false))
|
||||
g_SaveCDOnMapEnd = true;
|
||||
else
|
||||
g_SaveCDOnMapEnd = false;
|
||||
*/
|
||||
g_SaveCDOnMapEnd = true;
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
@@ -1725,10 +1731,13 @@ public void Handler_VoteFinishedGeneric(char[] map,
|
||||
g_MapVoteCompleted = true;
|
||||
//checking on MapStart and MapEnd is not good enough. Players are not considered alive and on teams at those points in time.
|
||||
//therefore instead applying the bool here after the mapvote completed.
|
||||
/*
|
||||
if(InternalAreRestrictionsActive(false))
|
||||
g_SaveCDOnMapEnd = true;
|
||||
else
|
||||
g_SaveCDOnMapEnd = false;
|
||||
*/
|
||||
g_SaveCDOnMapEnd = true;
|
||||
|
||||
//PrintToChatAll("map: %s", map);
|
||||
if (g_ChangeTime == MapChange_MapEnd)
|
||||
@@ -2094,20 +2103,21 @@ void CreateNextVote()
|
||||
delete OldMapListSnapshot;
|
||||
}
|
||||
|
||||
if(InternalAreRestrictionsActive(false))
|
||||
|
||||
//if(InternalAreRestrictionsActive(false))
|
||||
//{
|
||||
StringMapSnapshot TimeMapListSnapshot = g_TimeMapList.Snapshot();
|
||||
for(int i = 0; i < TimeMapListSnapshot.Length; i++)
|
||||
{
|
||||
StringMapSnapshot TimeMapListSnapshot = g_TimeMapList.Snapshot();
|
||||
for(int i = 0; i < TimeMapListSnapshot.Length; i++)
|
||||
{
|
||||
TimeMapListSnapshot.GetKey(i, map, sizeof(map));
|
||||
int Cooldown;
|
||||
g_TimeMapList.GetValue(map, Cooldown);
|
||||
TimeMapListSnapshot.GetKey(i, map, sizeof(map));
|
||||
int Cooldown;
|
||||
g_TimeMapList.GetValue(map, Cooldown);
|
||||
|
||||
if(Cooldown > GetTime())
|
||||
RemoveStringFromArray(tempMaps, map);
|
||||
}
|
||||
delete TimeMapListSnapshot;
|
||||
if(Cooldown > GetTime())
|
||||
RemoveStringFromArray(tempMaps, map);
|
||||
}
|
||||
delete TimeMapListSnapshot;
|
||||
//}
|
||||
|
||||
int voteSize = GetVoteSize(0);
|
||||
int limit = (voteSize < GetArraySize(tempMaps) ? voteSize : GetArraySize(tempMaps));
|
||||
@@ -2153,12 +2163,16 @@ void CreateNextVote()
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (InternalGetMapCooldownTime(map) > GetTime())
|
||||
continue;
|
||||
//requested by keen in september 2024 that we have a pool that is prioritized when taking random maps.
|
||||
//it might be considered micro management which would indeed be bad. i guess this is mostly about pleasing a regular players request
|
||||
//which does not seem too outlandish to make possible.
|
||||
pickedFromCasualPool++;
|
||||
break;
|
||||
}
|
||||
if(InternalGetMapCooldownTime(map) > GetTime())
|
||||
continue;
|
||||
|
||||
if(!InternalAreRestrictionsActive(false))
|
||||
break;
|
||||
@@ -2166,8 +2180,6 @@ void CreateNextVote()
|
||||
if(InternalGetMapVIPRestriction(map))
|
||||
continue;
|
||||
|
||||
if(InternalGetMapCooldownTime(map) > GetTime())
|
||||
continue;
|
||||
|
||||
if(InternalGetMapTimeRestriction(map) != 0)
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user