| 1349 | } |
| 1350 | |
| 1351 | StateRef<BattleUnitImagePack> Agent::getImagePack(BodyPart bodyPart) const |
| 1352 | { |
| 1353 | EquipmentSlotType slotType = AgentType::getArmorSlotType(bodyPart); |
| 1354 | |
| 1355 | auto e = getFirstItemInSlot(slotType); |
| 1356 | if (e) |
| 1357 | return e->type->body_image_pack; |
| 1358 | auto it = type->image_packs[appearance].find(bodyPart); |
| 1359 | if (it != type->image_packs[appearance].end()) |
| 1360 | return it->second; |
| 1361 | return nullptr; |
| 1362 | } |
| 1363 | |
| 1364 | sp<Equipment> Agent::getEquipmentAt(const Vec2<int> &position) const |
| 1365 | { |