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

Function GetRating

src/town_cmd.cpp:4022–4031  ·  view source on GitHub ↗

* Get the rating of a town for the #_current_company. * @param t Town to get the rating from. * @return Rating of the current company in the given town. */

Source from the content-addressed store, hash-verified

4020 * @return Rating of the current company in the given town.
4021 */
4022static int GetRating(const Town *t)
4023{
4024 if (_town_rating_test) {
4025 auto it = _town_test_ratings.find(t);
4026 if (it != _town_test_ratings.end()) {
4027 return it->second;
4028 }
4029 }
4030 return t->ratings[_current_company];
4031}
4032
4033/**
4034 * Changes town rating of the current company

Callers 2

ChangeTownRatingFunction · 0.85
CheckforTownRatingFunction · 0.85

Calls 2

findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected