Skip to content

Commit

Permalink
Swallow intermittent bugs due to race conditions from updating game c…
Browse files Browse the repository at this point in the history
…omponents collection
  • Loading branch information
ethanmoffat committed May 20, 2022
1 parent c76e4f2 commit 032df93
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion EndlessClient/GameExecution/EndlessGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,13 @@ protected override void Update(GameTime gameTime)

_previousKeyState = currentKeyState;

base.Update(gameTime);
try
{
base.Update(gameTime);
}
catch (ArgumentOutOfRangeException)
{
}
}

#endif
Expand Down
2 changes: 1 addition & 1 deletion EndlessClient/Rendering/Character/CharacterRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public void DrawToSpriteBatch(SpriteBatch spriteBatch)
_effectRenderer.DrawInFrontOfTarget(spriteBatch);

if (_gameStateProvider.CurrentState == GameStates.PlayingTheGame)
_healthBarRenderer.DrawToSpriteBatch(spriteBatch);
_healthBarRenderer?.DrawToSpriteBatch(spriteBatch);
}

#endregion
Expand Down

0 comments on commit 032df93

Please sign in to comment.