Skip to content

Commit

Permalink
Fix: for GUI network servers, name the first company the same as any …
Browse files Browse the repository at this point in the history
…other company
  • Loading branch information
rubidium42 committed May 5, 2024
1 parent 5721810 commit 7ff8978
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/network/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,12 @@ void NetworkOnGameStart()
NetworkClientInfo *ci = NetworkClientInfo::GetByClientID(CLIENT_ID_SERVER);

Check failure

Code scanning / CodeQL

Inconsistent nullness check Error

The result of this call to GetByClientID is not checked for null, but 96% of calls to GetByClientID check for null.
ci->client_playas = c->index;

/*
* If the company has not been named yet, the company was just started.
* Otherwise it would have gotten a name already, so announce it as a new company.
*/
if (c->name_1 == STR_SV_UNNAMED && c->name.empty()) NetworkServerNewCompany(c, ci);

ShowClientList();
}
}
Expand Down

0 comments on commit 7ff8978

Please sign in to comment.