summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-07-21 00:47:44 +0300
committerAndrei Karas <akaras@inbox.ru>2015-07-21 00:47:44 +0300
commitfffbd86a1014ad169ed2d68ea58cdddf346faa14 (patch)
tree713c96fcf7421ca87f638d312e752179281cb8fe /src/being
parent1941b81a5a278f26a5d7e1f91903ab04c92e2cd1 (diff)
downloadplus-fffbd86a1014ad169ed2d68ea58cdddf346faa14.tar.gz
plus-fffbd86a1014ad169ed2d68ea58cdddf346faa14.tar.bz2
plus-fffbd86a1014ad169ed2d68ea58cdddf346faa14.tar.xz
plus-fffbd86a1014ad169ed2d68ea58cdddf346faa14.zip
Add missing checks and non null attributes.
Diffstat (limited to 'src/being')
-rw-r--r--src/being/being.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index bf05eb7eb..746cc729b 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -3611,7 +3611,7 @@ void Being::addItemParticles(const int id, const SpriteDisplay &display)
pi = (*it).second;
}
- if (!pi->particles.empty())
+ if (!pi || !pi->particles.empty())
return;
// setup particle effects
@@ -3735,7 +3735,10 @@ void Being::setRiding(const bool b)
if (b)
{
mHorseInfo = HorseDB::get(1);
- mHorseSprite = mHorseInfo->sprite;
+ if (mHorseInfo)
+ mHorseSprite = mHorseInfo->sprite;
+ else
+ mHorseSprite = nullptr;
}
else
{