Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2004:
[Freeciv-Dev] (PR#11340) Unit orders aborted glitch
Home

[Freeciv-Dev] (PR#11340) Unit orders aborted glitch

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#11340) Unit orders aborted glitch
From: "Dave Vandervies" <dj3vande@xxxxxxxxxx>
Date: Sat, 4 Dec 2004 16:38:35 -0800
Reply-to: rt@xxxxxxxxxxx

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


Greetings.

Not sure if this counts as a bug or just an annoyance, but:

Starting a connect-road and then building a road on one of the tiles
that the unit working on the connect needs to go through will cause
that unit to abort its orders with the message
"Orders for Workers aborted since they gave an invalid activity".
(I have no reason to believe that this glitch is limited to roads, but
that's all I've done that would cause it.)

When the cause is building a city on the endpoint of the connect order,
this is just a minor annoyance.  When it's the middle of a long road-
under-construction that it aborts on, the annoyance becomes less
minor.

I've hacked my local copy of the beta-4 code to avoid this by doing the
following:
-Add can_unit_fake_activity and friends in common/unit.c, analogous to
  can_unit_do_activity and friends, which return true if the units
  would be able to perform an activity had it not been done already.
-In the switch inside execute_orders (in server/unittools.c), under
  ORDER_ACTIVITY, if can_unit_do_activity(punit,activity) returns
  false, check can_unit_fake_activity(punit,activity) and if that
  returns true skips the current item and continues with the rest of
  the order list.


I'm willing to share my changes if anybody is interested in cleaning
them up and getting them into the official code repository.


dave





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