From e668ab141d6b006b790d2b0a8fc515d13b78317e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 4 Jun 2011 17:00:09 +0300 Subject: Cleanup part list and beinginfo. --- src/resources/beinginfo.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/resources/beinginfo.cpp') diff --git a/src/resources/beinginfo.cpp b/src/resources/beinginfo.cpp index 80f416b91..d6865449e 100644 --- a/src/resources/beinginfo.cpp +++ b/src/resources/beinginfo.cpp @@ -29,7 +29,8 @@ #include "debug.h" -BeingInfo *BeingInfo::Unknown = new BeingInfo; +BeingInfo *BeingInfo::unknown = new BeingInfo; +Attack *BeingInfo::empty = new Attack(SpriteAction::ATTACK, "", ""); BeingInfo::BeingInfo(): mName(_("unnamed")), @@ -102,8 +103,6 @@ const std::string &BeingInfo::getSound(SoundEvent event) const const Attack *BeingInfo::getAttack(int type) const { - // need remove in destructor? - static Attack *empty = new Attack(SpriteAction::ATTACK, "", ""); Attacks::const_iterator i = mAttacks.find(type); return (i == mAttacks.end()) ? empty : (*i).second; @@ -118,3 +117,11 @@ void BeingInfo::addAttack(int id, std::string action, mAttacks[id] = new Attack(action, particleEffect, missileParticle); } + +void BeingInfo::clear() +{ + delete unknown; + unknown = 0; + delete empty; + empty = 0; +} -- cgit v1.2.3-60-g2f50