Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-03-03 23:15:39 +0000
committerStijn Buys <ingar@osirion.org>2012-03-03 23:15:39 +0000
commit8fbb2425220389ee69749ccd93407a0db73678fd (patch)
tree3ef7b7615711f9dd552760fbf0c26a801421082b /src/game/base/game.cc
parentf0a4a7d7213b61714542d64a7559648a086df26a (diff)
Added core::Slots class template, replaced Entity::set_inventory() with Entity::add_inventory().
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();
}
}