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

Function CommandFlagsToDCFlags

src/command_func.h:49–56  ·  view source on GitHub ↗

* Extracts the DC flags needed for DoCommand from the flags returned by GetCommandFlags * @param cmd_flags Flags from GetCommandFlags * @return flags for DoCommand */

Source from the content-addressed store, hash-verified

47 * @return flags for DoCommand
48 */
49static constexpr inline DoCommandFlags CommandFlagsToDCFlags(CommandFlags cmd_flags)
50{
51 DoCommandFlags flags = {};
52 if (cmd_flags.Test(CommandFlag::NoWater)) flags.Set(DoCommandFlag::NoWater);
53 if (cmd_flags.Test(CommandFlag::Auto)) flags.Set(DoCommandFlag::Auto);
54 if (cmd_flags.Test(CommandFlag::AllTiles)) flags.Set(DoCommandFlag::AllTiles);
55 return flags;
56}
57
58/** Helper class to keep track of command nesting level. */
59struct RecursiveCommandCounter {

Callers 11

ExecuteMethod · 0.85
OnPlaceObjectMethod · 0.85
PlaceAirportFunction · 0.85
PlaceRail_StationFunction · 0.85
OnPlaceMouseUpMethod · 0.85
HandleStationPlacementFunction · 0.85
ShowBuildBridgeWindowFunction · 0.85
GrowTownWithBridgeFunction · 0.85
GrowTownWithTunnelFunction · 0.85
PlaceRoadStopFunction · 0.85
OnPlaceMouseUpMethod · 0.85

Calls 2

TestMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected