Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2002:
[Freeciv-Dev] Re: [Patch] turn_founded
Home

[Freeciv-Dev] Re: [Patch] turn_founded

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>
Cc: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [Patch] turn_founded
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 4 Mar 2002 20:56:36 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Mon, Mar 04, 2002 at 07:28:56PM +0000, Gregory Berkolaiko wrote:
> On Mon, 4 Mar 2002, Raimar Falke wrote:
> 
> > On Mon, Mar 04, 2002 at 06:00:04PM +0000, Gregory Berkolaiko wrote:
> > > On Mon, 4 Mar 2002, Raimar Falke wrote:
> > > 
> > > > On Mon, Mar 04, 2002 at 12:25:57PM +0000, Gregory Berkolaiko wrote:
> > > > > Marginally related thing:
> > > > > 
> > > > > turn_changed_target doesn't seem to be _used_ anywhere.  It is set 
> > > > > and saved alright, but not used.
> > > > > 
> > > > > even if it was used, it would be logical to convert it to bool too.
> > > > 
> > > > Yes it should be removed.
> > > 
> > > Easier said than done.  I made a patch but it breaks the compatibility.  
> > > How do you go about this?
> > 
> > Capability?!
> 
> yes, I know.  But isn't it a bit silly, having a capability for 
> _not_having_ a variable.

We also had this for bonus_tech. But yes it is unnormal.

> a cunning solution exists though.
> in your turn_founded patch you introduce int turn_founded
> in my patch I kill int turn_changed_target.
> 
> we can unite the patches!

Shocking ;)

> so, in packets.c we would do
> 
>       cptr = put_uint32(cptr, req->turn_founded);
> 
> instead of 
> 
>       cptr=put_sint16(cptr, req->turn_changed_target);
> 
> not conditional on capability, but read
> 
> +  if (has_capability("turn_founded", pc->capability)) {
> +    iget_uint32(&iter, &packet->turn_founded);
> +  } else {
> +    /* get it and ignore it */
> +    iget_uint32(&iter, &packet->turn_founded);
> +    packet->turn_founded = -1;
> +  }
> 
> conditional on capability.  uint should be changed to sint of course.
> 
> If we send turn_founded instead of turn_changed_target to an older 
> program, it wouldn't break since the value is ignored anyway.
> 
> I guess it's a nasty trick, but I think it's imaginative.
> Do you want to do it, do you want me to attach your patch to mine or you 
> don't even want to talk about it?

Let us make two seperate patches.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  Microsoft does have a year 2000 problem. I'm part of it. I'm running Linux.


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