diff options
author | Stijn Buys <ingar@osirion.org> | 2012-03-03 23:15:39 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2012-03-03 23:15:39 +0000 |
commit | 8fbb2425220389ee69749ccd93407a0db73678fd (patch) | |
tree | 3ef7b7615711f9dd552760fbf0c26a801421082b /src/core/entity.cc | |
parent | f0a4a7d7213b61714542d64a7559648a086df26a (diff) |
Added core::Slots class template, replaced Entity::set_inventory() with Entity::add_inventory().
Diffstat (limited to 'src/core/entity.cc')
-rw-r--r-- | src/core/entity.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/entity.cc b/src/core/entity.cc index 4a6528f..2f23444 100644 --- a/src/core/entity.cc +++ b/src/core/entity.cc @@ -271,12 +271,12 @@ void Entity::set_info(const Info *info) entity_info = info; } -void Entity::set_inventory(Inventory *inventory) +Inventory *Entity::add_inventory() { - if (entity_inventory && (entity_inventory != inventory)) { - delete entity_inventory; - } - entity_inventory = inventory; + if (!entity_inventory) { + entity_inventory = new Inventory(); + } + return(entity_inventory); } void Entity::set_zone(Zone *zone) |