summaryrefslogtreecommitdiff
path: root/src/being/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-01-03 23:21:00 +0300
committerAndrei Karas <akaras@inbox.ru>2014-01-03 23:21:00 +0300
commit60efa209d05ecdfe5c6ad69c8e76e6a34b206e1b (patch)
treee6f2c349b29030ad86144aeb4d8a4ffab09cd0d5 /src/being/being.cpp
parent576d56c7b5636cf95ac8eb1650949da6a26a1bd7 (diff)
downloadmv-60efa209d05ecdfe5c6ad69c8e76e6a34b206e1b.tar.gz
mv-60efa209d05ecdfe5c6ad69c8e76e6a34b206e1b.tar.bz2
mv-60efa209d05ecdfe5c6ad69c8e76e6a34b206e1b.tar.xz
mv-60efa209d05ecdfe5c6ad69c8e76e6a34b206e1b.zip
dont spawn pet on collision.
Diffstat (limited to 'src/being/being.cpp')
-rw-r--r--src/being/being.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 511df5dc8..e155dc886 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -3312,6 +3312,14 @@ void Being::fixPetSpawnPos(int &dstX, int &dstY) const
}
dstX += offsetX;
dstY += offsetY;
+ if (mMap)
+ {
+ if (!mMap->getWalk(dstX, dstY, getWalkMask()))
+ {
+ dstX = mOwner->getTileX();
+ dstY = mOwner->getTileY();
+ }
+ }
}
void Being::playSfx(const SoundInfo &sound, Being *const being,