feat(client): add assertion in ClientServices::Connection (#107)

Co-authored-by: fallenoak <git@fallenoak.me>
This commit is contained in:
Tristan 'Natrist' Cormier 2025-10-08 16:11:01 -04:00 committed by GitHub
parent d27f6e45fd
commit 9a48558429
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -155,7 +155,7 @@ void ClientServices::ConnectToSelectedServer() {
} }
ClientConnection* ClientServices::Connection() { ClientConnection* ClientServices::Connection() {
// TODO assertion? STORM_ASSERT(ClientServices::s_currentConnection);
return ClientServices::s_currentConnection; return ClientServices::s_currentConnection;
} }
@ -390,9 +390,7 @@ void ClientServices::SetCharacterInfo(const CHARACTER_INFO* info) {
void ClientServices::SetMessageHandler(NETMESSAGE msgId, MESSAGE_HANDLER handler, void* param) { void ClientServices::SetMessageHandler(NETMESSAGE msgId, MESSAGE_HANDLER handler, void* param) {
STORM_ASSERT(handler); STORM_ASSERT(handler);
STORM_ASSERT(ClientServices::s_currentConnection); ClientServices::Connection()->SetMessageHandler(msgId, handler, param);
ClientServices::s_currentConnection->SetMessageHandler(msgId, handler, param);
} }
int32_t ClientServices::SetSelectedRealmInfo(int32_t a1) { int32_t ClientServices::SetSelectedRealmInfo(int32_t a1) {