mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-28 17:09:10 +00:00
Codechange: add non-nullptr asserts in cases where it should never be nullptr
Though where similar calls are checked for nullptr as in those instances of the use of that function it can actually return nullptr. In other words, write down the assumption that the function never returns nullptr in an assert.
This commit is contained in:
@@ -1532,6 +1532,7 @@ static void NetworkAutoCleanCompanies()
|
||||
|
||||
if (!_network_dedicated) {
|
||||
const NetworkClientInfo *ci = NetworkClientInfo::GetByClientID(CLIENT_ID_SERVER);
|
||||
assert(ci != nullptr);
|
||||
if (Company::IsValidID(ci->client_playas)) clients_in_company[ci->client_playas] = true;
|
||||
}
|
||||
|
||||
@@ -1918,6 +1919,7 @@ void NetworkServerDoMove(ClientID client_id, CompanyID company_id)
|
||||
if (client_id == CLIENT_ID_SERVER && _network_dedicated) return;
|
||||
|
||||
NetworkClientInfo *ci = NetworkClientInfo::GetByClientID(client_id);
|
||||
assert(ci != nullptr);
|
||||
|
||||
/* No need to waste network resources if the client is in the company already! */
|
||||
if (ci->client_playas == company_id) return;
|
||||
|
Reference in New Issue
Block a user