summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
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())
{