Don't error in the network delay notifier.

Differential Revision: https://code.wildfiregames.com/D3788
This was SVN commit r25181.
This commit is contained in:
wraitii 2021-04-02 14:20:37 +00:00
parent 2d53308e1b
commit 8ed1bc2fd1
3 changed files with 2 additions and 6 deletions

View file

@ -7,7 +7,6 @@ class NetworkDelayOverlay
{
this.netDelayOverlay = Engine.GetGUIObjectByName("netDelayOverlay");
this.netDelayOverlay.caption="toto";
this.caption = translate(this.Caption);
this.sprintfData = {};

View file

@ -2,7 +2,7 @@
<!-- Put this under the regular gamestateNotifications. -->
<object name="netDelayOverlay"
type="text"
hidden="false"
hidden="true"
ghost="true"
z="199"
size="100%-300 60 100%-110 80"

View file

@ -98,13 +98,10 @@ void SetSimRate(float rate)
g_Game->SetSimRate(rate);
}
int GetPendingTurns(const ScriptRequest& rq)
int GetPendingTurns()
{
if (!g_Game || !g_Game->GetTurnManager())
{
ScriptException::Raise(rq, "Game is not started");
return 0;
}
return g_Game->GetTurnManager()->GetPendingTurns();
}