diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-03-26 22:53:27 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-03-26 22:53:27 +0300 |
commit | 6b0ecb7f33231e79277f36faf6a8e0e94339efca (patch) | |
tree | b9c5c8ee7fa9c3a472dd32a3439c64e912a075f3 | |
parent | 13c52b749ade0698610824c4df734ef105d5a2a7 (diff) | |
download | mv-6b0ecb7f33231e79277f36faf6a8e0e94339efca.tar.gz mv-6b0ecb7f33231e79277f36faf6a8e0e94339efca.tar.bz2 mv-6b0ecb7f33231e79277f36faf6a8e0e94339efca.tar.xz mv-6b0ecb7f33231e79277f36faf6a8e0e94339efca.zip |
Fix wrong iterator usage in replace sprites function.
-rw-r--r-- | src/being/being.cpp | 5 |
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()) { |