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

Method findFirstSlot

game/state/shared/agent.cpp:569–581  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

567}
568
569Vec2<int> Agent::findFirstSlot(StateRef<AEquipmentType> equipmentType)
570{
571 Vec2<int> pos = {-1, 0};
572 for (auto &slot : type->equipment_layout->slots)
573 {
574 if (canAddEquipment(slot.bounds.p0, equipmentType))
575 {
576 pos = slot.bounds.p0;
577 break;
578 }
579 }
580 return pos;
581}
582
583sp<AEquipment> Agent::addEquipmentByType(GameState &state, StateRef<AEquipmentType> equipmentType,
584 bool allowFailure)

Callers 1

tryPlaceItemMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected