diff options
author | Stijn Buys <ingar@osirion.org> | 2014-12-07 16:12:49 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2014-12-07 16:12:49 +0000 |
commit | 2c98d3eef488233b99a76ca44d69c1c9d53404af (patch) | |
tree | 9259bad9533d1de7381b291eee19fd319b8366eb /src/game/base/patrol.cc | |
parent | acb236d0df275394095ab43e8519aebc4811865d (diff) |
Cleanup of the slots code, unified model weapon and dock tags into a single slots list,
load dock tags into entity slots, represent entity slot locations in entity coordinate space,
have r_slots render fixed-size slot indicators regardless of model scale.
Diffstat (limited to 'src/game/base/patrol.cc')
-rw-r--r-- | src/game/base/patrol.cc | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/game/base/patrol.cc b/src/game/base/patrol.cc index 51b7e2a..9b805de 100644 --- a/src/game/base/patrol.cc +++ b/src/game/base/patrol.cc @@ -318,16 +318,11 @@ void Patrol::create_patrol() npc->menus().clear(); } - // install inventory - if (!npc->inventory()) { - npc->add_inventory(); - } + // inventory has been added by the Ship constructor + assert (npc->inventory()); - // install slots - if (!npc->slots()) { - npc->add_slots(); - slots()->load(model()); - } + // slots have been added by the Ship constructor + assert(npc->slots()); // install weapons for (core::Slots::iterator slit = npc->slots()->begin(); slit != npc->slots()->end(); ++slit) { @@ -335,11 +330,11 @@ void Patrol::create_patrol() core::Item *item = 0; - if (slot->type() == model::Weapon::Cannon) { + if (slot->type() == model::Slot::Cannon) { if (npctype->cannon()) { item = new core::Item(npctype->cannon()); } - } else if (slot->type() == model::Weapon::Turret) { + } else if (slot->type() == model::Slot::Turret) { if (npctype->turret()) { item = new core::Item(npctype->turret()); } |