From 700032eb94fb6a67bef01606387ec5779e2714cf Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 22 May 2018 23:38:10 +0300 Subject: Fix crash with wrong moving path. --- src/net/ea/beingrecv.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/net/ea/beingrecv.cpp') 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; -- cgit v1.2.3-60-g2f50