fixed bugs related to mapchange/round restarts
This commit is contained in:
parent
ae9ea5083a
commit
db669f3b05
@ -27,11 +27,21 @@ public void OnPluginStart()
|
||||
}
|
||||
OnMapStart();
|
||||
HookEvent("round_start", Event_RoundStart, EventHookMode_PostNoCopy);
|
||||
HookEvent("round_end", OnRoundEnd, EventHookMode_Post);
|
||||
}
|
||||
|
||||
public Action OnRoundEnd(Handle event, const char[] name, bool dontBroadcast)
|
||||
{
|
||||
for (int i = 1; i <= MaxClients; i++)
|
||||
if (IsValidClient(i) && !IsFakeClient(i))
|
||||
{
|
||||
reset_client(i);
|
||||
}
|
||||
}
|
||||
|
||||
public void Event_RoundStart(Handle event, const char[] name, bool dontBroadcast)
|
||||
{
|
||||
for (int i = 1; i <= MaxClients; i++)
|
||||
for (int i = 1; i <= MaxClients; i++)
|
||||
if (IsValidClient(i) && !IsFakeClient(i))
|
||||
{
|
||||
reset_client(i);
|
||||
@ -63,6 +73,10 @@ public void reset_client(int client)
|
||||
bot_finished_surf_coords[client][1] = 0.0;
|
||||
bot_finished_surf_coords[client][2] = 0.0;
|
||||
is_forward_called[client] = false;
|
||||
if (BotMimic_IsPlayerMimicing(client))
|
||||
{
|
||||
BotMimic_StopPlayerMimic(client);
|
||||
}
|
||||
}
|
||||
|
||||
//unknown delay before forward is called.
|
||||
@ -77,7 +91,7 @@ public int BotMimic_OnPlayerMimicLoops(int client)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bot_finished_surf_coords[client][0] != 0.0)
|
||||
if (bot_finished_surf_coords[client][0] != 0.0 && BotMimic_IsPlayerMimicing(client))
|
||||
{
|
||||
BotMimic_StopPlayerMimic(client);
|
||||
TeleportEntity(client, bot_finished_surf_coords[client], NULL_VECTOR, NULL_VECTOR);
|
||||
@ -206,6 +220,11 @@ public void SQL_OnQueryCompleted(Database db, DBResultSet results, const char[]
|
||||
|
||||
public void OnMapStart()
|
||||
{
|
||||
for (int i = 1; i <= MaxClients; i++)
|
||||
if (IsValidClient(i) && !IsFakeClient(i))
|
||||
{
|
||||
reset_client(i);
|
||||
}
|
||||
char map_name[256];
|
||||
GetCurrentMap(map_name, sizeof(map_name));
|
||||
if (!g_dDatabase)
|
||||
|
Loading…
Reference in New Issue
Block a user