| 1333 | } |
| 1334 | |
| 1335 | void 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 | |
| 1359 | void Vehicle::enterBuilding(GameState &state, StateRef<Building> b) |
| 1360 | { |
no test coverage detected