Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2004:
[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, 20 Apr 2004 21:43:14 -0700
Reply-to: rt@xxxxxxxxxxx

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

On Tue, Apr 20, 2004 at 08:08:51PM -0700, Jason Short wrote:
> 
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=2521 >
> 
> On the topic of effects-pre:
> 
> - I don't understand why there is a game.can_xxx and also a 
> pplayer->can_nuke.

the reason this is done is as an extension. With pplayer->can_nuke, you can
treat this effect as a Player-range effect as well as a World-range effect.
The code to treat this case is not too hairy in the regular code, maybe it
is in the savegame code?
 
> - I don't understand why can_xxx is needed when we could just check 
> game.global_wonders[id] (where id is determined by some flag).  Is it 
> because the effect need not always come from a wonder?

Absolutely. Could easily come via a tech or government, or a plain old
building.

> But anyway...
> 
> This patch is an "update" of effects-pre8 that hopefully makes these 
> values work.  I haven't tested it.
> 
> - game.can_xxx is kept and is actually sent to the client.

This does not need to happen. If there is a global effect in operation it
will be sent by the global effect route to the client.

> - pplayer->can_xxx is removed.

Could be done, but why? Unless the savegame problems are too nasty...

> - game.can_xxx is set when the appropriate wonders are built (eventually 
> this should be a flag or effect; for now it's just hard-coded to the 
> enumerated value).
> 
> - game.can_xxx is checked instead of checking for the existance of those 
> wonders.

Both of these are done in the effects-immed8.diff. See
gamehand.c:handle_enable_{nuke|space}()

> - Savegame backwards compatability is added.  If the appropriate 
> capability isn't set the game checks game.global_wonders to find out if 
> the appropriate wonders have been built.

I'll wait on the patch review.

-mike




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