Skip to content

Commit

Permalink
Fix exception when calling OnClient() or OnServer() when game isn't s…
Browse files Browse the repository at this point in the history
…tarted
  • Loading branch information
Xottab-DUTY committed Jan 29, 2018
1 parent 46df6ba commit ef830f9
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/xrGame/game_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
#include "game_type.h"
#include "Level.h"

bool OnServer() throw() { return Level().IsServer(); }
bool OnClient() throw() { return Level().IsClient(); }
bool IsGameTypeSingle() throw() { return (g_pGamePersistent->GameType() == eGameIDSingle); }
bool OnServer() noexcept
{
return g_pGameLevel != nullptr ? Level().IsServer() : false;
}

bool OnClient() noexcept
{
return g_pGameLevel != nullptr ? Level().IsClient() : false;
}

bool IsGameTypeSingle() throw()
{
return g_pGamePersistent->GameType() == eGameIDSingle;
}

0 comments on commit ef830f9

Please sign in to comment.