Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2003:
[Freeciv-Dev] Re: (PR#2521) general effects framework
Home

[Freeciv-Dev] Re: (PR#2521) general effects framework

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] Re: (PR#2521) general effects framework
From: "Mike Kaufman" <kaufman@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 11 Mar 2003 08:28:53 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Tue, Mar 11, 2003 at 07:48:17AM -0800, Raimar Falke wrote:
> 
> About what ints are you speaking here? BV uses unsigned char which should be
> ok.

struct effect {
  /* save a bunch of memory */
  struct {
    int active:1;      /* is effect active? */
    int pending:1;     /* is effect active except for cond_bldg? */
    int changed:1;     /* has effect changed since last update? */
    int was_active:1;  /* temporary variable for calculation of 'changed' */
  
    int nat:1;         /* has req. nation (or doesn't need one) */
    int adv:1;         /* has req. advance (or doesn't need one) */
    int gov:1;         /* has req. gov (or doesn't need one) */
    int bldg:1;        /* has req. bldg (only partially cached) */
    int condeff:1;     /* has cond_eff (only partially cached) */
    int no_equiv:1;    /* there is no equivalent bldg that suppresses */
  } has;
  
  struct player *plr;
  struct city *home;       /* NULL if effect has no location (origin) */
  int id;                  /* id of thing generating effect */
  
  struct effect_defn *defn;  /* a pointer to the effect definition */
};

those should be unsigned I think. I forgot that you haven't seen this yet. 
It's been in my code for so long I'd forgotten when I'd included it.

obviously BV doesn't have his problem since it isn't a true bitfield
persay.

-mike



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