Fix one one the possible reasons for "SendDroidMove: Invalid move order" assert.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4473 4a71c877-e1ca-e34f-864e-861f7616d084
master
Roman C 2008-04-03 22:00:14 +00:00
parent 9d7679b740
commit f60f39c853
1 changed files with 5 additions and 4 deletions

View File

@ -190,10 +190,11 @@ static inline int32_t map_coord(int32_t worldCoord)
*/
static inline void clip_world_offmap(int* worldX, int* worldY)
{
*worldX = MAX(0, *worldX);
*worldY = MAX(0, *worldY);
*worldX = MIN(world_coord(mapWidth), *worldX);
*worldY = MIN(world_coord(mapHeight), *worldY);
// x,y must be > 0
*worldX = MAX(1, *worldX);
*worldY = MAX(1, *worldY);
*worldX = MIN(world_coord(mapWidth) - 1, *worldX);
*worldY = MIN(world_coord(mapHeight) - 1, *worldY);
}
/* maps a position down to the corner of a tile */