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

Method enterVehicle

game/state/shared/agent.cpp:343–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341}
342
343void Agent::enterVehicle(GameState &state, StateRef<Vehicle> v)
344{
345 if (v->getPassengers() >= v->getMaxPassengers())
346 {
347 return;
348 }
349 if (currentBuilding)
350 {
351 currentBuilding->currentAgents.erase({&state, shared_from_this()});
352 currentBuilding = nullptr;
353 }
354 if (currentVehicle)
355 {
356 currentVehicle->currentAgents.erase({&state, shared_from_this()});
357 currentVehicle = nullptr;
358 }
359 currentVehicle = v;
360 currentVehicle->currentAgents.insert({&state, shared_from_this()});
361}
362
363bool Agent::canTeleport() const
364{

Callers 3

addVehiclesToListMethod · 0.80
loadBattleVehicleFunction · 0.80

Calls 3

getPassengersMethod · 0.80
insertMethod · 0.80
getMaxPassengersMethod · 0.45

Tested by

no test coverage detected