summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-03-26 22:53:27 +0300
committerAndrei Karas <akaras@inbox.ru>2018-03-26 22:53:27 +0300
commit6b0ecb7f33231e79277f36faf6a8e0e94339efca (patch)
treeb9c5c8ee7fa9c3a472dd32a3439c64e912a075f3 /src/being
parent13c52b749ade0698610824c4df734ef105d5a2a7 (diff)
downloadplus-6b0ecb7f33231e79277f36faf6a8e0e94339efca.tar.gz
plus-6b0ecb7f33231e79277f36faf6a8e0e94339efca.tar.bz2
plus-6b0ecb7f33231e79277f36faf6a8e0e94339efca.tar.xz
plus-6b0ecb7f33231e79277f36faf6a8e0e94339efca.zip
Fix wrong iterator usage in replace sprites function.
Diffstat (limited to 'src/being')
-rw-r--r--src/being/being.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index d447221f8..74750aa44 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -4436,8 +4436,11 @@ void Being::recalcSpritesOrder() restrict2
if (repIt == itemReplacer.end())
{
repIt = itemReplacer.find(0);
- if (repIt->second == 0)
+ if (repIt == itemReplacer.end() ||
+ repIt->second == 0)
+ {
repIt = itemReplacer.end();
+ }
}
if (repIt != itemReplacer.end())
{