Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: PATCH: LOAD_MAP_DATA
Home

[Freeciv-Dev] Re: PATCH: LOAD_MAP_DATA

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev <freeciv-dev@xxxxxxxxxxx>, Thue Janus Kristensen <thue@xxxxxxx>
Subject: [Freeciv-Dev] Re: PATCH: LOAD_MAP_DATA
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 13 Oct 2001 08:46:02 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Fri, Oct 12, 2001 at 07:27:26PM -0400, Jason Dorje Short wrote:
>                 {
>                   char *pch = strchr(terrain_chars, ch);
>                   if(!pch) {
>                     freelog(LOG_FATAL, "unknown terrain type (map.t) in map "
>                       "at position (%d,%d): %d '%c'", x, y, ch, ch);
>                     exit(1);
>                   }
>                   map_get_player_tile(x, y, plr)->terrain=pch-terrain_chars;
>                 }

What do you think about a terrain_char2terrain function/macro? This
would encapsulate this.

> Oh, one other thing: some of the current (CVS) code skips over map lines
> that don't exist.  The LOAD_MAP_POS macro doesn't do this, instead it
> asserts that the line exists and then continues blindly.  I don't know
> if it's actually necessary to skip empty lines (presumably it's a
> backwards-compatibility thing), but I think another parameter, force,
> needs to be added to the macro that will control this.

Thue? Is it needed to skip empty lines?

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "If at first you don't succeed... well so much for skydiving."


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