Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Re: [PATCH] Formatting cleanup.
Home

[Freeciv-Dev] Re: [PATCH] Formatting cleanup.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Cc: Gaute B Strokkenes <gs234@xxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] Formatting cleanup.
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 18 Sep 2001 09:03:45 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Mon, Sep 17, 2001 at 10:03:15PM -0400, Ross W. Wetmore wrote:
> RCS file: /home/freeciv/CVS/freeciv/server/maphand.c,v
> retrieving revision 1.84
> diff -u -r1.84 maphand.c
> --- server/maphand.c  2001/09/02 13:37:59     1.84
> +++ server/maphand.c  2001/09/11 19:00:29
> @@ -952,12 +952,11 @@
>  struct player_tile *map_get_player_tile(int x, int y,
>                                       struct player *pplayer)
>  {
> -  if (y < 0 || y >= map.ysize) {
> +  if (!is_real_tile(x, y)) {
>      freelog(LOG_ERROR, "Trying to get nonexistant tile at %i,%i", x, y);

Has anybody managed to trigger this case? It is an error in my eyes
and should be treated as such. I would vote for an
"assert(0);abort();".

> -    return pplayer->private_map
> -     + map_adjust_x(x) + map_adjust_y(y) * map.xsize;
> -  } else
> -    return pplayer->private_map + map_adjust_x(x) + y * map.xsize;
> +  }
> +  nearest_real_pos(&x, &y);
> +  return pplayer->private_map + map_inx(x, y);
>  }

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Transported to a surreal landscape, a young girl kills the first woman
  she meets and then teams up with three complete strangers to kill again."
    -- TV listing for the Wizard of Oz in the Marin Independent Journal


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