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

Function SetCompanyManagerFaceStyle

src/company_cmd.cpp:1435–1442  ·  view source on GitHub ↗

* Set a company face style. * Changes both the style index and the label. * @param cmf The CompanyManagerFace to change. * @param style The style to set. */

Source from the content-addressed store, hash-verified

1433 * @param style The style to set.
1434 */
1435void SetCompanyManagerFaceStyle(CompanyManagerFace &cmf, uint style)
1436{
1437 const FaceSpec *spec = GetCompanyManagerFaceSpec(style);
1438 assert(spec != nullptr);
1439
1440 cmf.style = style;
1441 cmf.style_label = spec->label;
1442}
1443
1444/**
1445 * Completely randomise a company manager face, including style.

Callers 5

CmdSetCompanyManagerFaceFunction · 0.85
OnClickMethod · 0.85
AfterLoadGameFunction · 0.85

Calls 1

Tested by

no test coverage detected