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

Function lowerLand

src/OpenLoco/src/Ui/Windows/TerraForm.cpp:1421–1452  ·  view source on GitHub ↗

0x00468DFD

Source from the content-addressed store, hash-verified

1419
1420 // 0x00468DFD
1421 static uint32_t lowerLand(uint8_t flags)
1422 {
1423 uint32_t cost;
1424 if ((flags & 1))
1425 {
1426 Common::sub_4A69DD();
1427 }
1428
1429 auto [pointA, pointB] = World::getMapSelectionArea();
1430 auto centre = (pointA + pointB) / 2;
1431 GameCommands::setErrorTitle(StringIds::error_cant_lower_land_here);
1432
1433 if (isMountainMode)
1434 {
1435 GameCommands::LowerRaiseLandMountainArgs args{};
1436 args.centre = centre;
1437 args.pointA = pointA;
1438 args.pointB = pointB;
1439 args.adjustment = -1;
1440 cost = GameCommands::doCommand(args, flags);
1441 }
1442 else
1443 {
1444 GameCommands::LowerLandArgs args{};
1445 args.centre = centre;
1446 args.pointA = pointA;
1447 args.pointB = pointB;
1448 args.corner = World::getMapSelectionCorner();
1449 cost = GameCommands::doCommand(args, flags);
1450 }
1451 return cost;
1452 }
1453
1454 // 0x00468D1D
1455 static uint32_t raiseLand(uint8_t flags)

Callers 2

onAdjustLandToolUpdateFunction · 0.70
toolDragFunction · 0.70

Calls 5

sub_4A69DDFunction · 0.85
getMapSelectionAreaFunction · 0.85
setErrorTitleFunction · 0.85
getMapSelectionCornerFunction · 0.85
doCommandFunction · 0.50

Tested by

no test coverage detected