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/game.cc')
-rw-r--r--src/game/base/game.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/game/base/game.cc b/src/game/base/game.cc
index 0610377..d8af507 100644
--- a/src/game/base/game.cc
+++ b/src/game/base/game.cc
@@ -1224,8 +1224,7 @@ bool Game::load_zone(core::Zone *zone)
} else {
inventory = entity->inventory();
if (!inventory) {
- inventory = new core::Inventory();
- entity->set_inventory(inventory);
+ inventory = entity->add_inventory();
}
}
@@ -1238,11 +1237,10 @@ bool Game::load_zone(core::Zone *zone)
zoneini.unknown_error("ship definition without entity");
} else if ((entity->moduletype() != planet_enttype) && (entity->moduletype() != station_enttype)) {
zoneini.unknown_error("ship definition for invalid entity type");
- } else {
+ } else {
inventory = entity->inventory();
if (!inventory) {
- inventory = new core::Inventory();
- entity->set_inventory(inventory);
+ inventory = entity->add_inventory();
}
}