diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-05-22 23:38:10 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-05-23 00:25:20 +0300 |
commit | 700032eb94fb6a67bef01606387ec5779e2714cf (patch) | |
tree | 4978ec6631f93d1a5ac4187e0dab3ccd5dad33b9 /src/net/ea/beingrecv.cpp | |
parent | f1dfe88c7a0c30de14439277c4ba7d69bd495fbf (diff) | |
download | mv-700032eb94fb6a67bef01606387ec5779e2714cf.tar.gz mv-700032eb94fb6a67bef01606387ec5779e2714cf.tar.bz2 mv-700032eb94fb6a67bef01606387ec5779e2714cf.tar.xz mv-700032eb94fb6a67bef01606387ec5779e2714cf.zip |
Fix crash with wrong moving path.
Diffstat (limited to 'src/net/ea/beingrecv.cpp')
-rw-r--r-- | src/net/ea/beingrecv.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/net/ea/beingrecv.cpp b/src/net/ea/beingrecv.cpp index 3b09502f4..b2909576d 100644 --- a/src/net/ea/beingrecv.cpp +++ b/src/net/ea/beingrecv.cpp @@ -462,6 +462,11 @@ void BeingRecv::processBeingMove3(Net::MessageIn &msg) { x2 -= dirx[dir]; y2 -= diry[dir]; + // fix possible wrong move outside of map + if (x2 < 0) + x2 = 0; + if (y2 < 0) + y2 = 0; path2.push_back(Position(x2, y2)); if (x2 == x && y2 == y) break; |