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

Method addEquipment

game/state/shared/agent.cpp:722–733  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

720}
721
722void Agent::addEquipment(GameState &state, sp<AEquipment> object, EquipmentSlotType slotType)
723{
724 Vec2<int> pos = findFirstSlotByType(slotType, object->type);
725 if (pos.x == -1)
726 {
727 LogError("Trying to add \"%s\" on agent \"%s\" failed: no valid slot found", type.id,
728 this->name);
729 return;
730 }
731
732 this->addEquipment(state, pos, object);
733}
734
735void Agent::addEquipment(GameState &state, Vec2<int> pos, sp<AEquipment> object)
736{

Callers 1

addEquipmentByTypeMethod · 0.95

Calls 3

withinMethod · 0.80
updateDisplayedItemMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected