Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2005:
[Freeciv-Dev] (PR#12616) Goto from offboard transporters
Home

[Freeciv-Dev] (PR#12616) Goto from offboard transporters

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: chrisk@xxxxxxxxx
Subject: [Freeciv-Dev] (PR#12616) Goto from offboard transporters
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 3 Jun 2005 15:28:40 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12616 >

> [chrisk - Fri Mar 25 11:37:53 2005]:

> The Goto remains avtive, even that the ship moved. But the path is now
> shifted, the unit follows the same vector to another target. But the old
> target is still marked with arrows on the map. The displayed path does not
> lead to the target anymore.

Yep.

At first I thought it would be best to include a tile for each order
(giving the tile the order is intended for).  However this requires a
fair bit of code to keep these tiles updated, and serializing them into
savegames isn't trivial.  This patch (for both branches) takes the
simpler approach of simply freeing the orders when certain actions
(transporter moving or teleportation) happen.

> Also please note the following: the *first* middle-click on the unit (on
> Goto, on land) does *not* display the target, any subsequent does.

This is a separate bug; it's an update bug I think.  I don't know why it
happens but on the first click the crosshair is undrawn immediately
after it's drawn.

-jason

Index: server/unittools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/unittools.c,v
retrieving revision 1.356
diff -u -r1.356 unittools.c
--- server/unittools.c  26 May 2005 04:58:20 -0000      1.356
+++ server/unittools.c  3 Jun 2005 22:18:22 -0000
@@ -1252,6 +1252,9 @@
                       unit_name(punit->type), pcity->name);
     }
 
+    /* Silently free orders since they won't be applicable anymore. */
+    free_unit_orders(punit);
+
     if (move_cost == -1)
       move_cost = punit->moves_left;
     return move_unit(punit, dst_tile, move_cost);
@@ -2808,6 +2811,10 @@
     /* Insert them again. */
     unit_list_iterate(cargo_units, pcargo) {
       unfog_area(unit_owner(pcargo), pdesttile, 
unit_type(pcargo)->vision_range);
+
+      /* Silently free orders since they won't be applicable anymore. */
+      free_unit_orders(pcargo);
+
       pcargo->tile = pdesttile;
 
       unit_list_prepend(pdesttile->units, pcargo);

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#12616) Goto from offboard transporters, Jason Short <=