MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / leaveBuilding

Method leaveBuilding

game/state/city/vehicle.cpp:1335–1357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1333}
1334
1335void Vehicle::leaveBuilding(GameState &state, Vec3<float> initialPosition, float initialFacing)
1336{
1337 LogInfo("Launching %s", this->name);
1338 if (this->tileObject)
1339 {
1340 LogError("Trying to launch already-launched vehicle");
1341 return;
1342 }
1343 auto bld = this->currentBuilding;
1344 if (bld)
1345 {
1346 bld->currentVehicles.erase({&state, shared_from_this()});
1347 this->currentBuilding = "";
1348 }
1349 this->position = initialPosition;
1350 this->goalPosition = initialPosition;
1351 this->facing = initialFacing;
1352 this->goalFacing = initialFacing;
1353 if (city->map)
1354 {
1355 city->map->addObjectToMap(state, shared_from_this());
1356 }
1357}
1358
1359void Vehicle::enterBuilding(GameState &state, StateRef<Building> b)
1360{

Callers 4

startMethod · 0.45
startMethod · 0.45
placeVehicleMethod · 0.45
loadBattleVehicleFunction · 0.45

Calls 1

addObjectToMapMethod · 0.80

Tested by

no test coverage detected