Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2004:
[Freeciv-Dev] Re: (PR#7131) client orders to replace client goto
Home

[Freeciv-Dev] Re: (PR#7131) client orders to replace client goto

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#7131) client orders to replace client goto
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 19 Jan 2004 09:24:42 -0800
Reply-to: rt@xxxxxxxxxxx

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

Raimar Falke wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=7131 >
> 
> On Mon, Jan 19, 2004 at 12:38:54AM -0800, Jason Short wrote:
> 
>>- Don't clear orders when changing the activity.  In the future it will 
>>be possible to have an activity while under orders.
> 
> So how can the user clear the orders of a unit?

Obviously changing the activity to IDLE won't do it, since the activity 
is _already_ IDLE.

Instead the client sends an orders route with length 0.  This is 
documented in unithand.c.  It's send by request_clear_orders (or 
something like that) in client/goto.c.

>>- Reinstate the enum activity_type enumeration.  Since these values
>>are put in the savegame we can't just remove ACTIVITY_PATROL without
>>completely breaking things.  Instead it's renamed as
>>ACTIVITY_PATROL_UNUSED and checked for when loading savegames.
> 
> Is this really necessary? Can this legacy handled by savegame.c alone? 
> Must all the other code see this?

It could be handled by savegame.c, but it takes a lot more work *in 
general*, because then not only do we have to catch ACTIVITY_PATROL but 
also the activities that come after it.  We have to completely renumber. 
  Although ACTIVITY_PATROL has no activities after it, when/if 
ACTIVITY_GOTO is removed this becomes excessively complicated.

For activity_patrol it would look like:

   if (!has_capability(capability_string, "no_patrol_activity")) {
     if (activity == 17) {
       /* Change old ACTIVITY_PATROL to ACTIVITY_IDLE. */
       activity = ACTIVITY_IDLE;
     }
   }

but for ACTIVITY_GOTO it would be about 10x as long.

Really this isn't any different than hard-coding the order of the 
network packets.  Since these values are all saved as integers there's 
really no way around it.

jason




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