summaryrefslogtreecommitdiff
path: root/src/resources/beinginfo.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-06-04 17:00:09 +0300
committerAndrei Karas <akaras@inbox.ru>2011-06-04 17:00:09 +0300
commite668ab141d6b006b790d2b0a8fc515d13b78317e (patch)
treeb4aa71e9a4af62c948183328bbf74c2e1bf4eb84 /src/resources/beinginfo.cpp
parent98cc93d2321b9be0a2a5ae6bf67aecf6adcdd2fb (diff)
downloadplus-e668ab141d6b006b790d2b0a8fc515d13b78317e.tar.gz
plus-e668ab141d6b006b790d2b0a8fc515d13b78317e.tar.bz2
plus-e668ab141d6b006b790d2b0a8fc515d13b78317e.tar.xz
plus-e668ab141d6b006b790d2b0a8fc515d13b78317e.zip
Cleanup part list and beinginfo.
Diffstat (limited to 'src/resources/beinginfo.cpp')
-rw-r--r--src/resources/beinginfo.cpp13
1 files changed, 10 insertions, 3 deletions
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;
+}