From a95fd43c19fccd5989a5325d14d185aa783e26c8 Mon Sep 17 00:00:00 2001 From: Per Inge Mathisen Date: Mon, 24 Mar 2008 16:06:43 +0000 Subject: [PATCH] Make sure we handle droid position close to origin correctly in updateDroidOrientation() git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4308 4a71c877-e1ca-e34f-864e-861f7616d084 --- src/move.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/move.c b/src/move.c index af13fb8b9..214bd1ff6 100644 --- a/src/move.c +++ b/src/move.c @@ -739,9 +739,9 @@ void updateDroidOrientation(DROID *psDroid) w = 20; hx0 = map_Height(psDroid->pos.x + w, psDroid->pos.y); - hx1 = map_Height(psDroid->pos.x - w, psDroid->pos.y); + hx1 = map_Height(MAX(0, psDroid->pos.x - w), psDroid->pos.y); hy0 = map_Height(psDroid->pos.x, psDroid->pos.y + w); - hy1 = map_Height(psDroid->pos.x, psDroid->pos.y - w); + hy1 = map_Height(psDroid->pos.x, MAX(0, psDroid->pos.y - w)); //update height in case were in the bottom of a trough if (((hx0 +hx1)/2) > (SDWORD)psDroid->pos.z)