MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / CanJoinCompany

Method CanJoinCompany

src/network/network.cpp:132–136  ·  view source on GitHub ↗

* Returns whether the given company can be joined by this client. * @param company_id The id of the company. * @return \c true when this company is allowed to join, otherwise \c false. */

Source from the content-addressed store, hash-verified

130 * @return \c true when this company is allowed to join, otherwise \c false.
131 */
132bool NetworkClientInfo::CanJoinCompany(CompanyID company_id) const
133{
134 Company *c = Company::GetIfValid(company_id);
135 return c != nullptr && c->allow_list.Contains(this->public_key);
136}
137
138/**
139 * Returns whether the given company can be joined by this client.

Callers 3

ConJoinCompanyFunction · 0.80
NetworkCanJoinCompanyFunction · 0.80
RebuildListCompanyMethod · 0.80

Calls 1

ContainsMethod · 0.45

Tested by

no test coverage detected