From 4fe43df6eaa21047ceb5c0b7612355684a015cee Mon Sep 17 00:00:00 2001 From: Christian Ohm Date: Sun, 15 Nov 2009 18:01:39 +0000 Subject: [PATCH] Don't check coordinates in CalcRadarPosition. Every call to it is saveguarded by calls to CoordInRadar, which uses almost the same code (exactly the same until r7458). So now the calculation in CoordInRadar is changed to be the same as in CalcRadarPosition, and CalcRadarPosition doesn't check anymore. Fixes #1069. git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8401 4a71c877-e1ca-e34f-864e-861f7616d084 --- src/radar.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/radar.c b/src/radar.c index df648bcdd..a9c78700e 100644 --- a/src/radar.c +++ b/src/radar.c @@ -200,13 +200,6 @@ void CalcRadarPosition(int mX, int mY, int *PosX, int *PosY) pos.x += radarWidth/2.0; pos.y += radarHeight/2.0; - if (pos.x<0 || pos.y<0 || pos.x>=radarWidth || pos.y>=radarHeight) - { - ASSERT(false, "clicked outside radar minimap (%d, %d) -> (%.1f,%.1f)", mX, mY, pos.x, pos.y); - *PosX = 0; - *PosY = 0; - return; - } CalcRadarPixelSize(&pixSizeH, &pixSizeV); sPosX = pos.x / pixSizeH; // adjust for pixel size sPosY = pos.y / pixSizeV; @@ -605,8 +598,8 @@ BOOL CoordInRadar(int x,int y) { pos = Vector2f_Rotate2f(pos, -player.r.y/DEG(1)); } - pos.x += radarWidth/2; - pos.y += radarHeight/2; + pos.x += radarWidth/2.0; + pos.y += radarHeight/2.0; if (pos.x<0 || pos.y<0 || pos.x>=radarWidth || pos.y>=radarHeight) {