(32460d493) Fixed: Wait timers running in tutorials when pause menu is open

This commit is contained in:
Joonas Rikkonen
2019-05-18 17:53:18 +03:00
parent 419754ccf1
commit b1326787f7
7 changed files with 88 additions and 74 deletions
@@ -198,19 +198,26 @@ namespace Barotrauma
public readonly float TotalTime;
float timer;
bool ignorePause;
public WaitForSeconds(float time)
public WaitForSeconds(float time, bool ignorePause = true)
{
timer = time;
TotalTime = time;
this.ignorePause = ignorePause;
}
public bool CheckFinished(float deltaTime)
{
#if !SERVER
if (ignorePause || !GUI.PauseMenuOpen)
{
timer -= deltaTime;
}
#else
timer -= deltaTime;
return timer<=0.0f;
#endif
return timer <= 0.0f;
}
}
}