[Freeciv-Dev] Re: PATCH: LOAD_MAP_DATA
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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."
|
|