diff options
author | Stijn Buys <ingar@osirion.org> | 2009-11-12 20:53:35 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2009-11-12 20:53:35 +0000 |
commit | 5ddb64795cc959916eeedbec8dc3f65c06f49698 (patch) | |
tree | ee7231607b0bf49528570e5d3badcdedcb33f54e /src/core/entity.cc | |
parent | 3605a7bd8fffebfba38d31025b6f33cb82626a3b (diff) |
initial commodities and entity inventory, bump network proto version to 18
Diffstat (limited to 'src/core/entity.cc')
-rw-r--r-- | src/core/entity.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/core/entity.cc b/src/core/entity.cc index ce313e6..d01d825 100644 --- a/src/core/entity.cc +++ b/src/core/entity.cc @@ -114,6 +114,9 @@ Entity::Entity(const unsigned int flags) : entity_visible = true; entity_serverside = false; + + entity_inventory = 0; + entity_info = 0; memset(entity_extension, 0, sizeof(entity_extension)); @@ -133,6 +136,9 @@ Entity::Entity(std::istream & is) entity_created = true; entity_destroyed = false; + + entity_inventory = 0; + entity_info = 0; memset(entity_extension, 0, sizeof(entity_extension)); } @@ -151,6 +157,10 @@ Entity::~Entity() delete(*it); } menus().clear(); + + // delete inventory + if (entity_inventory) + delete entity_inventory; if (entity_zone) entity_zone->remove(this); @@ -168,6 +178,19 @@ void Entity::clear_updates() entity_oldzone = 0; } +void Entity::set_info(Info *info) +{ + entity_info = info; +} + +void Entity::set_inventory(Inventory *inventory) +{ + if (entity_inventory && (entity_inventory != inventory)) { + delete entity_inventory; + } + entity_inventory = inventory; +} + void Entity::set_zone(Zone *zone) { if (entity_zone == zone) |