instead of hard coding to ze_random_v9 it now takes the startup map when server is restarted
This commit is contained in:
parent
c0cddad8cb
commit
d78c39cf3c
@ -1014,7 +1014,7 @@ public Action CS_OnTerminateRound(float &delay, CSRoundEndReason &reason)
|
|||||||
//that is rather problematic because it often leads to the very first people connecting wanting to leave again because the game is stuck.
|
//that is rather problematic because it often leads to the very first people connecting wanting to leave again because the game is stuck.
|
||||||
if (timeleft < 0 && g_iNextmapState == 0)
|
if (timeleft < 0 && g_iNextmapState == 0)
|
||||||
{
|
{
|
||||||
LogMessage("in CS_OnTerminateRound being hard stuck. switching map to ze_random_v9. timeleft: %i", timeleft);
|
LogMessage("in CS_OnTerminateRound being hard stuck. switching map to default start map. timeleft: %i", timeleft);
|
||||||
CreateTimer(1.0, Timer_fall_back_map_switch, INVALID_HANDLE, TIMER_FLAG_NO_MAPCHANGE);
|
CreateTimer(1.0, Timer_fall_back_map_switch, INVALID_HANDLE, TIMER_FLAG_NO_MAPCHANGE);
|
||||||
}
|
}
|
||||||
return Plugin_Continue;
|
return Plugin_Continue;
|
||||||
@ -1035,7 +1035,17 @@ public Action unfreeze_players2(Handle hTimer, Handle dp)
|
|||||||
|
|
||||||
public Action Timer_fall_back_map_switch(Handle hTimer, Handle dp)
|
public Action Timer_fall_back_map_switch(Handle hTimer, Handle dp)
|
||||||
{
|
{
|
||||||
ForceChangeLevel("ze_random_v9", "nobody voted at mapvote");
|
char map_line[256];
|
||||||
|
File f = OpenFile("cfg/defaultmap.cfg", "r");
|
||||||
|
if (f != null)
|
||||||
|
{
|
||||||
|
f.ReadLine(map_line, sizeof(map_line));
|
||||||
|
CloseHandle(f);
|
||||||
|
}
|
||||||
|
ReplaceString(map_line, sizeof(map_line), "map ", "");
|
||||||
|
TrimString(map_line);
|
||||||
|
//LogMessage("map_line: %s", map_line);
|
||||||
|
ForceChangeLevel(map_line, "nobody voted at mapvote");
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user