Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2003:
[Freeciv-Dev] Re: (PR#2707) Goto get stuck after attacking
Home

[Freeciv-Dev] Re: (PR#2707) Goto get stuck after attacking

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: admerik@xxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2707) Goto get stuck after attacking
From: "Per I. Mathisen via RT" <rt@xxxxxxxxxxxxxx>
Date: Fri, 17 Jan 2003 00:57:38 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Thu, 2 Jan 2003, Guest via RT wrote:
> I did a Goto to attack a unit and then when the enemy unit got killed
> my unit still has a "g" on it, and it becomes active i.e. blinking, and
> I can move it around (while still having the "g" on it self).
>
> Then I the attack a city with this unit, using manual movement, I
> get "Howitzer aborted GOTO as there are units in the way", and the g
> does not get removed. Ironically when I use GOTO I can attack fine

Here is a fix for this bug. It should fix the problem without causing
problems elsewhere in the code, and it can be fixed in S1_14 without doing
another beta to test it, IMHO.

  - Per

Index: server/unithand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/unithand.c,v
retrieving revision 1.234.2.3
diff -u -r1.234.2.3 unithand.c
--- server/unithand.c   14 Nov 2002 22:17:22 -0000      1.234.2.3
+++ server/unithand.c   17 Jan 2003 08:51:22 -0000
@@ -807,6 +807,10 @@
     }
   }
 
+  if (pwinner == punit && punit->activity != ACTIVITY_IDLE) {
+    /* Ensure we remove ACTIVITY_GOTO here */
+    set_unit_activity(punit, ACTIVITY_IDLE);
+  }
   send_unit_info(NULL, pwinner);
 }
 

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