Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/base/patrol.cc')
-rw-r--r--src/game/base/patrol.cc17
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());
}