Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/base/npc.cc23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/game/base/npc.cc b/src/game/base/npc.cc
index 44cad7c..e0999da 100644
--- a/src/game/base/npc.cc
+++ b/src/game/base/npc.cc
@@ -51,20 +51,19 @@ NPC *NPC::add_wingman(Ship *leader)
for (size_t i = 0; i < leader->slots()->size(); ++i) {
core::Slot *slot = leader->slots()->operator[](i);
- if (!slot->has_flag(core::Slot::Mounted) && slot->item()) {
- continue;
- }
+ if (slot->item() && slot->has_flag(core::Slot::Mounted)) {
- core::Item *npc_item = new core::Item(slot->item()->info());
- npc_item->set_amount(slot->item()->amount());
- npc_item->set_flags(slot->item()->flags());
- npc_item->set_flag(core::Item::Mounted);
- npc->inventory()->add(npc_item);
+ core::Item *npc_item = new core::Item(slot->item()->info());
+ npc_item->set_amount(slot->item()->amount());
+ npc_item->set_flags(slot->item()->flags());
+ npc_item->set_flag(core::Item::Mounted);
+ npc->inventory()->add(npc_item);
- core::Slot *npc_slot = npc->slots()->operator[](i);
- npc_slot->set_item(npc_item);
- npc_slot->set_flag(core::Slot::Active);
- npc_slot->set_flag(core::Slot::Mounted);
+ core::Slot *npc_slot = npc->slots()->operator[](i);
+ npc_slot->set_item(npc_item);
+ npc_slot->set_flag(core::Slot::Active);
+ npc_slot->set_flag(core::Slot::Mounted);
+ }
}
npc->calculate_weapon_range();