Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2003:
[Freeciv-Dev] (PR#6905) Possible Solution
Home

[Freeciv-Dev] (PR#6905) Possible Solution

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: vanevery@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#6905) Possible Solution
From: "Guest" <rt-guest@xxxxxxxxxxx>
Date: Thu, 4 Dec 2003 00:15:22 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=6905 >

I think I've found the problem:

from /client/gui-win32/citydlg.c:
----------------------------------
static void city_dlg_mouse(struct city_dialog *pdialog, int x, int y,
                           bool is_overview)
{
...

  /* click on map */
  if ((y>=pdialog->map.y)&&(y<(pdialog->map.y+pdialog->map_h)))
    {
      if ((x>=pdialog->map.x)&&(x<(pdialog->map.x+pdialog->map_w)))
        {
          int tile_x,tile_y;

          if (canvas_to_city_pos(&tile_x, &tile_y,
                                 pdialog->map.x, pdialog->map.y)) {
            city_toggle_worker(pdialog->pcity, tile_x, tile_y);
          }
        }
    }
----------------------------------
change:
          if (canvas_to_city_pos(&tile_x, &tile_y,
                                 pdialog->map.x, pdialog->map.y))

to:
          if (canvas_to_city_pos(&tile_x, &tile_y,
                                 x, y))
----------------------------------
That should fix the problem. I'm having trouble compiling the CVS for
windows, but I have a savegame that seems to confirm this part of the
code to be the problem. Log into the savegame as "name". Open the dialog
box for one of the cities other than Birka or Uppsala. Try changing the
production. Nothing happens. Now try the same for Birka and Uppsala. No
matter where you click on the map, it toggles the production for one
particular square (the one that would be the top left square if the map
were rotated counter-clockwise 45 degrees). It appears that the above
code is passing the coordinates of the top left part of the map, rather
than the coordinates where the user clicked.

Attachment: win_city_production.gz
Description: application/gzip


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#6905) Possible Solution, Guest <=