summaryrefslogtreecommitdiff
path: root/src/flooritem.cpp
diff options
context:
space:
mode:
authorBertram <bertram@cegetel.net>2009-10-15 22:51:33 +0200
committerBertram <bertram@cegetel.net>2009-10-15 22:51:33 +0200
commit7da8ae1c1463a9659d776ff497ad18157cc2917c (patch)
tree7b24594b44831f9bc6d42f6f22960429c8615bbc /src/flooritem.cpp
parent59657fcbfa88a8f7a15bf4350f8addf399e20bda (diff)
downloadmana-7da8ae1c1463a9659d776ff497ad18157cc2917c.tar.gz
mana-7da8ae1c1463a9659d776ff497ad18157cc2917c.tar.bz2
mana-7da8ae1c1463a9659d776ff497ad18157cc2917c.tar.xz
mana-7da8ae1c1463a9659d776ff497ad18157cc2917c.zip
Fixed a potential segfault.
Diffstat (limited to 'src/flooritem.cpp')
-rw-r--r--src/flooritem.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/flooritem.cpp b/src/flooritem.cpp
index 9420afb4..090f4da7 100644
--- a/src/flooritem.cpp
+++ b/src/flooritem.cpp
@@ -69,8 +69,9 @@ void FloorItem::draw(Graphics *graphics, int offsetX, int offsetY) const
{
Image *image = mItem->getDrawImage();
- if (image && mAlpha != image->getAlpha())
- image->setAlpha(mAlpha);
+ if (image)
+ if (mAlpha != image->getAlpha())
+ image->setAlpha(mAlpha);
graphics->drawImage(image, mX * 32 + offsetX, mY * 32 + offsetY);
}