Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2005:
[Freeciv-Dev] Re: (PR#12546) Divide handicaps to real handicaps and chea
Home

[Freeciv-Dev] Re: (PR#12546) Divide handicaps to real handicaps and chea

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: marko.lindqvist@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#12546) Divide handicaps to real handicaps and cheats
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 19 Mar 2005 13:15:09 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12546 >

Marko Lindqvist wrote:

>   This can hardly be left after player effects. I'd say that this is 
> prerequisite for them. Player effects are not very general if 
> ai_handicap() / ai_cheat() / player_has_effect() / whatever() *callers* 
> hardcode behavior for human players.

I agree.  A consistent interface will help in writing player effects.

>   But ai_handicap() could be renamed in this change, to one without any 
> 'ai' -prefix. player_has_effect() ?

player_has_handicap() for now.  Don't call it "effect" until we actually 
use effects.

> To sum, typical uses would look something like this:
> 
> if(player_has_effect(pplayer, C_MAP) || map_is_known(pplayer, x, y))
> { ... }

This check should better go directly into map_is_known().  Yes this 
gives problems when human players connect to the AI.  But the 
alternative is that we forget to check it and/or the AI cheats in lots 
of places.

jason





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