Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2003:
[Freeciv-Dev] (PR#2753) Fix unreal map position
Home

[Freeciv-Dev] (PR#2753) Fix unreal map position

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#2753) Fix unreal map position
From: "Raimar Falke via RT" <rt@xxxxxxxxxxxxxx>
Date: Tue, 7 Jan 2003 10:16:48 -0800
Reply-to: rt@xxxxxxxxxxxxxx


William reported this on IRC. Confirmed for 1.13.0 and CVS. Per:
probably also contained in beta3 but the fix may be another one. With
the Xaw client try to goto the explorer. If you move the mouse south
you will get a assert for an unreal position. Fix is to copy the
function body of the GTK client. Jason: this is another candidate for
unification.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  "brand memory are for windows users that think their stability
   problems come from the memory"
    -- bomek in #freeciv

Attachment: xaw_unreal_bug.gz
Description: xaw_unreal_bug.gz

Index: client/gui-xaw/mapctrl.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/mapctrl.c,v
retrieving revision 1.60
diff -u -u -r1.60 mapctrl.c
--- client/gui-xaw/mapctrl.c    2003/01/01 11:51:34     1.60
+++ client/gui-xaw/mapctrl.c    2003/01/07 18:08:47
@@ -280,14 +280,12 @@
 **************************************************************************/
 void update_line(int window_x, int window_y)
 {
+  int x, y, old_x, old_y;
+
   if ((hover_state == HOVER_GOTO || hover_state == HOVER_PATROL)
       && draw_goto_line) {
-    int old_x, old_y;
-    int x = map_view_x0 + window_x/NORMAL_TILE_WIDTH;
-    int y = map_view_y0 + window_y/NORMAL_TILE_HEIGHT;
-    int is_real = normalize_map_pos(&x, &y);
-    assert(is_real);
- 
+    get_map_xy(window_x, window_y, &x, &y);
+
     get_line_dest(&old_x, &old_y);
     if (!same_pos(old_x, old_y, x, y)) {
       draw_line(x, y);

[Prev in Thread] Current Thread [Next in Thread]