From 6b0ecb7f33231e79277f36faf6a8e0e94339efca Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 26 Mar 2018 22:53:27 +0300 Subject: Fix wrong iterator usage in replace sprites function. --- src/being/being.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/being') 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()) { -- cgit v1.2.3-60-g2f50