Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/entity.cc')
-rw-r--r--src/core/entity.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/entity.cc b/src/core/entity.cc
index 98fef0e..20e1b05 100644
--- a/src/core/entity.cc
+++ b/src/core/entity.cc
@@ -56,6 +56,7 @@ void Entity::erase(unsigned int id)
Registry::iterator it = entity_registry.find(id);
if (it != entity_registry.end()) {
delete((*it).second);
+ (*it).second = 0;
entity_registry.erase(it);
} else {
con_warn << "Could not erase entity " << id << "!\n";
@@ -171,8 +172,10 @@ Entity::Entity(std::istream & is)
Entity::~Entity()
{
- if (entity_clientstate)
+ if (entity_clientstate) {
delete entity_clientstate;
+ entity_clientstate = 0;
+ }
if (entity_zone)
entity_zone->remove(this);