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/core/entity.cc
parentf0a4a7d7213b61714542d64a7559648a086df26a (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.cc10
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)