If type is null we look for any slot, if type is not null we look for slot that can fit the type
| 551 | |
| 552 | // If type is null we look for any slot, if type is not null we look for slot that can fit the type |
| 553 | Vec2<int> Agent::findFirstSlotByType(EquipmentSlotType slotType, |
| 554 | StateRef<AEquipmentType> equipmentType) |
| 555 | { |
| 556 | Vec2<int> pos = {-1, 0}; |
| 557 | for (auto &slot : type->equipment_layout->slots) |
| 558 | { |
| 559 | if (slot.type == slotType && |
| 560 | (!equipmentType || canAddEquipment(slot.bounds.p0, equipmentType))) |
| 561 | { |
| 562 | pos = slot.bounds.p0; |
| 563 | break; |
| 564 | } |
| 565 | } |
| 566 | return pos; |
| 567 | } |
| 568 | |
| 569 | Vec2<int> Agent::findFirstSlot(StateRef<AEquipmentType> equipmentType) |
| 570 | { |