MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / rightReleasedDock

Function rightReleasedDock

src/OpenLoco/src/Ui/ViewportInteraction.cpp:1164–1179  ·  view source on GitHub ↗

0x004A5CC5

Source from the content-addressed store, hash-verified

1162
1163 // 0x004A5CC5
1164 static void rightReleasedDock(World::StationElement* station, const World::Pos2 pos)
1165 {
1166 if (!Ui::Windows::Construction::isStationTabOpen())
1167 {
1168 Ui::Windows::Construction::openWithFlags(1ULL << 30);
1169 return;
1170 }
1171 GameCommands::setErrorTitle(StringIds::cant_remove_ship_port);
1172 GameCommands::PortRemovalArgs args;
1173 Pos2 firstTile = pos - World::kOffsets[station->sequenceIndex()];
1174 args.pos = Pos3(firstTile.x, firstTile.y, station->baseHeight());
1175 if (GameCommands::doCommand(args, GameCommands::Flags::apply) != GameCommands::kFailure)
1176 {
1177 Audio::playSound(Audio::SoundId::demolish, Audio::ChannelId::effects, GameCommands::getPosition());
1178 }
1179 }
1180
1181 // 0x004BB116
1182 static void rightReleasedTree(World::TreeElement* tree, const World::Pos2 pos)

Callers 1

handleRightReleasedFunction · 0.85

Calls 7

isStationTabOpenFunction · 0.85
openWithFlagsFunction · 0.85
setErrorTitleFunction · 0.85
playSoundFunction · 0.85
baseHeightMethod · 0.80
doCommandFunction · 0.50
sequenceIndexMethod · 0.45

Tested by

no test coverage detected