Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2004:
[Freeciv-Dev] (PR#7524) Re: Freeciv commit: jdorje: Remove player_can_se
Home

[Freeciv-Dev] (PR#7524) Re: Freeciv commit: jdorje: Remove player_can_se

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#7524) Re: Freeciv commit: jdorje: Remove player_can_see_unit and player_can_se...
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Wed, 25 Feb 2004 08:44:09 -0800
Reply-to: rt@xxxxxxxxxxx

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

On Tue, Feb 24, 2004 at 04:00:42PM -0800, Raimar Falke wrote:
> Message:
>   Remove player_can_see_unit and player_can_see_unit_at_location,
>   and fold their functionality into can_player_see_unit_at. Add a
>   new function can_player_see_unit, a simple wrapper for
>   can_player_see_unit_at. Change existing callers of the removed
>   functions to use one of the two remaining functions.

The comment suggests that no semantic is changed. However:

> -    } else if (!ptptother && !punit->transported_by &&
> -            player_can_see_unit(game.player_ptr, punit)) {
> +    } else if (!ptptother && !punit->transported_by) {

and

> -  if (player_can_see_unit(game.player_ptr, punit) &&
> -      (tile_visible_mapcanvas(map_x, map_y) ||
> -       tile_visible_mapcanvas(dest_x, dest_y))) {
> +  if (tile_visible_mapcanvas(map_x, map_y)
> +      || tile_visible_mapcanvas(dest_x, dest_y)) {

Can you tell me that this was intended?!

> +/****************************************************************************
> +  Checks if a unit can be seen by pplayer at (x,y).
> +  A player can see a unit if he:
> +  (a) can see the tile AND
> +  (b) can see the unit at the tile (i.e. unit not invisible at this tile) AND
> +  (c) the unit is outside a city OR in an allied city AND
                                    ^^
> +  (d) the unit isn't in a transporter, or we are allied AND
                                          ^^
> +  (e) the unit isn't in a transporter, or we can see the transporter
                                          ^^

Are the last two "or"s less important? And yes I know that you just
moved the text around.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "#!/usr/bin/perl -w
  if ( `date +%w` != 1 ) {
    die "This script only works on Mondays." ;
  }"
    -- from chkars.pl by Cornelius Krasel in de.comp.os.linux.misc




[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#7524) Re: Freeciv commit: jdorje: Remove player_can_see_unit and player_can_se..., Raimar Falke <=