[Freeciv-Dev] Re: (PR#8619) AutoReply: Obscure Bug related to ISO coordi
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=8619 >
Your is_border_map_pos is slightly wrong. You have
+bool IS_BORDER_MAP_POS(int map_x, int map_y, int dist)
+{
+ int x, y;
+ map_to_native_pos(&x, &y, map_x, map_y);
+ return ((x) < (dist) || (x) >= map.xsize - (dist)
+ || (y) < (dist) || (y) >= map.ysize - (dist));
+}
But because iso-native coordinates are compressed in the X direction
this isn't quite right. I think it should be something like:
bool IS_BORDER_MAP_POS(int map_x, int map_y, int dist)
{
int x, y;
map_to_native_pos(&x, &y, map_x, map_y);
return ((x) < (dist) || (x) >= map.xsize - (dist)
|| (y) < (2 * dist) || (y) >= map.ysize - (2 * dist));
}
for iso-maps (of course this won't work for non-iso maps). Your
original implementation that worked directly in map positions could also
work, but you may need to multiple dist by 2 in this case also.
However I don't see how this explains the errors you're getting. That
will take a closer look.
jason
- [Freeciv-Dev] Re: (PR#8619) AutoReply: Obscure Bug related to ISO coordinated and BORDER macro, Marcelo Burda, 2004/04/29
- [Freeciv-Dev] Re: (PR#8619) AutoReply: Obscure Bug related to ISO coordinated and BORDER macro, Jason Short, 2004/04/29
- [Freeciv-Dev] Re: (PR#8619) AutoReply: Obscure Bug related to ISO coordinated and BORDER macro,
Jason Short <=
- [Freeciv-Dev] Re: (PR#8619) AutoReply: Obscure Bug related to ISO coordinated and BORDER macro, Jason Short, 2004/04/29
- [Freeciv-Dev] Re: (PR#8619) AutoReply: Obscure Bug related to ISO coordinated and BORDER macro, Marcelo Burda, 2004/04/29
- [Freeciv-Dev] Re: (PR#8619) AutoReply: Obscure Bug related to ISO coordinated and BORDER macro, Jason Short, 2004/04/29
- [Freeciv-Dev] Re: (PR#8619) AutoReply: Obscure Bug related to ISO coordinated and BORDER macro, Marcelo Burda, 2004/04/29
- [Freeciv-Dev] (PR#8619) implementing IS_BORDER_MAP_POS for iso-maps, Marcelo Burda, 2004/04/29
- [Freeciv-Dev] (PR#8619) Obscure Bug related to ISO coordinated and BORDER macro, Marcelo Burda, 2004/04/29
|
|