mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-06 18:08:26 +00:00
Fixed errors when saving checkpoints on inactive bots.
This commit is contained in:
parent
8a7d3d4de0
commit
4176d68b86
@ -1692,6 +1692,13 @@ bool SaveCheckpoint(int client, int index)
|
||||
int style = Shavit_GetReplayBotStyle(target);
|
||||
int track = Shavit_GetReplayBotTrack(target);
|
||||
|
||||
if(style < 0 || track < 0)
|
||||
{
|
||||
Shavit_PrintToChat(client, "%T", "CommandAliveSpectate", client, gS_ChatStrings[sMessageVariable], gS_ChatStrings[sMessageText], gS_ChatStrings[sMessageVariable], gS_ChatStrings[sMessageText]);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
snapshot[bTimerEnabled] = true;
|
||||
snapshot[fCurrentTime] = Shavit_GetReplayTime(style, track);
|
||||
snapshot[bClientPaused] = false;
|
||||
|
||||
@ -401,6 +401,11 @@ public int Native_GetReplayTime(Handle handler, int numParams)
|
||||
int style = GetNativeCell(1);
|
||||
int track = GetNativeCell(2);
|
||||
|
||||
if(style < 0 || track < 0)
|
||||
{
|
||||
return view_as<int>(0.0);
|
||||
}
|
||||
|
||||
if(gB_CentralBot)
|
||||
{
|
||||
if(gA_CentralCache[iCentralReplayStatus] == Replay_End)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user