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
master
Christian Ohm 2009-11-15 18:01:39 +00:00 committed by Git SVN Gateway
parent 14d0c58a10
commit 4fe43df6ea
1 changed files with 2 additions and 9 deletions

View File

@ -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)
{