[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]
<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
|
|