[Freeciv-Dev] Re: PATCH: LOAD_MAP_DATA
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Raimar Falke wrote:
>
> 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.
Yes. Actually I made it a function, along with hex2dec - much prettier
that way.
The hex2dec/char2terrain functions are currently at the top of the file
near DEC2HEX(), dec2hex[], and terrain_chars[], but could be moved down
lower. Once we decide on the line-forcing issue I'll be ready to submit
a real patch (no patch attached for now).
jason
|
|