Skip to content

Commit ee67c2f

Browse files
authored
Make sure we always have a game type when we ask for it (ddnet#11635)
2 parents ff9068c + c8100f2 commit ee67c2f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/game/server/gamecontext.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4712,7 +4712,12 @@ bool CGameContext::IsClientHighBandwidth(int ClientId) const
47124712
}
47134713

47144714
CUuid CGameContext::GameUuid() const { return m_GameUuid; }
4715-
const char *CGameContext::GameType() const { return m_pController && m_pController->m_pGameType ? m_pController->m_pGameType : ""; }
4715+
const char *CGameContext::GameType() const
4716+
{
4717+
dbg_assert(m_pController, "no controller");
4718+
dbg_assert(m_pController->m_pGameType, "no gametype");
4719+
return m_pController->m_pGameType;
4720+
}
47164721
const char *CGameContext::Version() const { return GAME_VERSION; }
47174722
const char *CGameContext::NetVersion() const { return GAME_NETVERSION; }
47184723

0 commit comments

Comments
 (0)