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

Method movePlaneTo

src/OpenLoco/src/Vehicles/VehicleHead.cpp:2800–2825  ·  view source on GitHub ↗

0x00426CA4

Source from the content-addressed store, hash-verified

2798
2799 // 0x00426CA4
2800 void VehicleHead::movePlaneTo(const World::Pos3& newLoc, const uint8_t newYaw, const Pitch newPitch)
2801 {
2802 Vehicle train(head);
2803 moveTo({ newLoc.x, newLoc.y, newLoc.z });
2804 tileX = 0;
2805
2806 train.veh1->moveTo({ newLoc.x, newLoc.y, newLoc.z });
2807 train.veh1->tileX = 0;
2808
2809 train.veh2->moveTo({ newLoc.x, newLoc.y, newLoc.z });
2810 train.veh2->tileX = 0;
2811
2812 // The first bogie of the plane is the shadow of the plane
2813 auto* shadow = train.cars.firstCar.front;
2814 auto height = coord_t{ TileManager::getHeight(newLoc) };
2815 shadow->moveTo({ newLoc.x, newLoc.y, height });
2816 shadow->spriteYaw = newYaw;
2817 shadow->spritePitch = Pitch::flat;
2818 shadow->tileX = 0;
2819
2820 auto* body = train.cars.firstCar.body;
2821 body->moveTo({ newLoc.x, newLoc.y, newLoc.z });
2822 body->spriteYaw = newYaw;
2823 body->spritePitch = newPitch;
2824 body->tileX = 0;
2825 }
2826
2827 // 0x00427C05
2828 // Input flags:

Callers 1

vehiclePlaceAirFunction · 0.80

Calls 2

getHeightFunction · 0.85
moveToMethod · 0.80

Tested by

no test coverage detected