Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] Re: [Patch] Special testing
Home

[Freeciv-Dev] Re: [Patch] Special testing

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Cc: Petr Baudis <pasky@xxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [Patch] Special testing
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 17 Feb 2002 12:00:38 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Sat, Feb 16, 2002 at 06:59:36PM +0000, Gregory Berkolaiko wrote:
>  --- Petr Baudis <pasky@xxxxxxxxxxx> wrote: 
> 
> =============================================================
> > RCS file: /home/freeciv/CVS/freeciv/common/map.c,v
> > retrieving revision 1.112
> > diff -u -r1.112 map.c
> > --- common/map.c      2002/02/14 15:17:14     1.112
> > +++ common/map.c      2002/02/16 16:19:19
> > @@ -480,29 +480,29 @@
> >      /* range 0 .. 5 , 2 standard */
> >  
> >    case T_FOREST:
> > -    if (map_get_tile(x, y)->special) return 5;
> > +    if (map_has_special(x, y, S_ALL)) return 5;
> >      return 3;
> ..snip..
> 
> Will this work? In fact, I can't imagine how this would.. The same issue 
> as with the binary or, IMHO. We mut either add a special case for S_ALL
> in 
> map_has_special(), introduce another function for this 
> (map_has_any_special()), or remove the assert etc from the
> map_has_special 
> and allow testing for more specials at once (which breaks encapsulation 
> again).
> 
> =================================================
> 
> It will definitely break the assert in contains_specail if there is
> anything special on the tile at all...
> Testing?

> I would do it this way:
> return (map_get_specail(x,y) == S_NO_SPECIAL ? 3 : 5);

I like this.

> It's slightly conceptually wrong

Why?

>, but I like it.  To make it better, you
> can take S_NO_SPECIAL outside enum, like S_ALL...

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  This customer comes into the computer store. "I'm looking for a mystery
  Adventure Game with lots of graphics. You know, something realy
  challenging". "Well," replied the clerk, "have you tried Windows 98 ?"


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