now making sure the special map race zones on mako can exist despite other zones being present

This commit is contained in:
jenz
2026-10-18 15:23:23 +02:00
parent 778a2addbd
commit 847181ff18
2 changed files with 8 additions and 9 deletions
@@ -9,8 +9,6 @@
#include <unloze_zones> #include <unloze_zones>
#pragma newdecls required #pragma newdecls required
static Handle g_hSpecialRoundCheck; static Handle g_hSpecialRoundCheck;
Handle g_hTimer_check_stage = null;
bool g_bCheckedRound;
char g_cMapname[g_dIndex]; char g_cMapname[g_dIndex];
public Plugin myinfo = public Plugin myinfo =
{ {
@@ -87,15 +85,12 @@ public void OnPluginEnd()
{ {
if (g_hSpecialRoundCheck != null) if (g_hSpecialRoundCheck != null)
delete g_hSpecialRoundCheck; delete g_hSpecialRoundCheck;
if (g_hTimer_check_stage != null)
delete g_hTimer_check_stage;
} }
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
// Purpose: // Purpose:
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
public void OnPluginStart() public void OnPluginStart()
{ {
g_hTimer_check_stage = CreateTimer(10.0, Timer_CheckStage, _, TIMER_REPEAT);
//hooks //hooks
HookEvent("round_start", Event_RoundStart, EventHookMode_PostNoCopy); HookEvent("round_start", Event_RoundStart, EventHookMode_PostNoCopy);
@@ -106,9 +101,8 @@ public void OnPluginStart()
public Action Timer_CheckStage(Handle timer, any userid) public Action Timer_CheckStage(Handle timer, any userid)
{ {
GetCurrentMap(g_cMapname, sizeof(g_cMapname)); GetCurrentMap(g_cMapname, sizeof(g_cMapname));
if (StrEqual(g_cMapname, "ze_FFVII_Mako_Reactor_v5_3", false) && g_bCheckedRound) if (StrEqual(g_cMapname, "ze_FFVII_Mako_Reactor_v5_3", false))
{ {
g_bCheckedRound = false;
// == 11 means its racemode on mako // == 11 means its racemode on mako
if (GetCurrentStage() == 11) if (GetCurrentStage() == 11)
{ {
@@ -121,7 +115,10 @@ public Action Timer_CheckStage(Handle timer, any userid)
while (i < l_iZoneCount) while (i < l_iZoneCount)
{ {
ZoneNameBasedOnIndex(i, l_cIndexName[i]); ZoneNameBasedOnIndex(i, l_cIndexName[i]);
if (StrContains(l_cIndexName[i], "MAKO", false) != -1)
{
Call_PushString(l_cIndexName[i]); Call_PushString(l_cIndexName[i]);
}
i++; i++;
} }
Call_Finish(); Call_Finish();
@@ -133,5 +130,5 @@ public Action Timer_CheckStage(Handle timer, any userid)
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
public void Event_RoundStart(Handle event, const char[] name, bool dontBroadcast) public void Event_RoundStart(Handle event, const char[] name, bool dontBroadcast)
{ {
g_bCheckedRound = true; CreateTimer(5.0, Timer_CheckStage, _);
} }
@@ -730,7 +730,9 @@ public void unloze_zoneLeave(int client, char[] zone)
} }
int race_zone_count = GetTotalRaceZones(); int race_zone_count = GetTotalRaceZones();
if (!(StrEqual(zone, g_cSpecialMapStart)) && !race_zone_count) if (!(StrEqual(zone, g_cSpecialMapStart)) && !race_zone_count)
{
return; return;
}
if (GetClientTeam(client) == CS_TEAM_CT) if (GetClientTeam(client) == CS_TEAM_CT)
{ {