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

Method enterBuilding

game/state/shared/agent.cpp:330–341  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

328}
329
330void Agent::enterBuilding(GameState &state, StateRef<Building> b)
331{
332 if (currentVehicle)
333 {
334 currentVehicle->currentAgents.erase({&state, shared_from_this()});
335 currentVehicle = nullptr;
336 }
337 currentBuilding = b;
338 currentBuilding->currentAgents.insert({&state, shared_from_this()});
339 position = (Vec3<float>)b->crewQuarters + Vec3<float>{0.5f, 0.5f, 0.5f};
340 goalPosition = position;
341}
342
343void Agent::enterVehicle(GameState &state, StateRef<Vehicle> v)
344{

Callers 1

updateHirableAgentsMethod · 0.45

Calls 1

insertMethod · 0.80

Tested by

no test coverage detected