diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-07-23 02:14:30 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-07-23 02:14:30 +0300 |
commit | 6a65a4cf5b6b10839254c0c5846ec2dbfea882f8 (patch) | |
tree | cdf1dcc071ab18575defff569d33f3cbc8be0348 /src/actormanager.cpp | |
parent | 1a5f8957c707625efbcf36722b057d5eda5a21bb (diff) | |
download | plus-6a65a4cf5b6b10839254c0c5846ec2dbfea882f8.tar.gz plus-6a65a4cf5b6b10839254c0c5846ec2dbfea882f8.tar.bz2 plus-6a65a4cf5b6b10839254c0c5846ec2dbfea882f8.tar.xz plus-6a65a4cf5b6b10839254c0c5846ec2dbfea882f8.zip |
Allow delete untracker being particle effects.
This fix some possible memory leaks.
Diffstat (limited to 'src/actormanager.cpp')
-rw-r--r-- | src/actormanager.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/actormanager.cpp b/src/actormanager.cpp index 7da8249b0..bee73cd05 100644 --- a/src/actormanager.cpp +++ b/src/actormanager.cpp @@ -405,6 +405,21 @@ Being *ActorManager::findBeing(const BeingId id) const return nullptr; } +ActorSprite *ActorManager::findActor(const BeingId id) const +{ + const ActorSpritesMapConstIterator it = mActorsIdMap.find(id); + if (it != mActorsIdMap.end()) + { + ActorSprite *const actor = (*it).second; + if (actor && + actor->getId() == id) + { + return actor; + } + } + return nullptr; +} + Being *ActorManager::findBeing(const int x, const int y, const ActorTypeT type) const { |