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

Method IsActionAvailable

src/script/api/script_town.cpp:262–268  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

260}
261
262/* static */ bool ScriptTown::IsActionAvailable(TownID town_id, TownAction town_action)
263{
264 EnforceCompanyModeValid(false);
265 if (!IsValidTown(town_id)) return false;
266
267 return ::GetMaskOfTownActions(ScriptObject::GetCompany(), ::Town::Get(town_id)).Test(::TownAction(town_action));
268}
269
270/* static */ bool ScriptTown::PerformTownAction(TownID town_id, TownAction town_action)
271{

Callers

nothing calls this directly

Calls 3

GetMaskOfTownActionsFunction · 0.85
TestMethod · 0.80
TownActionEnum · 0.70

Tested by

no test coverage detected