Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2001:
[Freeciv-Dev] Re: new civworld patch
Home

[Freeciv-Dev] Re: new civworld patch

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Mike Kaufman <mkaufman@xxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: new civworld patch
From: Thue <thue@xxxxxxx>
Date: Wed, 21 Feb 2001 00:34:57 +0100

On Tuesday 20 February 2001 23:32, Mike Kaufman wrote:
> > In the normal client this is done implicitly by choosing the tiles. We
> > might want to keep it consistent.
>
> ok, I wasn't reading the code very carefully. changed in next rev.
>
> > Oh, and the rectangle paint got me into an infinite, _very_ memory
> > hungry, loop. Basically it allocated so fast that X had grinded so much
> > to a halt I almost couldn't give orders to the mashine. When my orders
> > finally got through 350MB of swap had been used :). Great fun; I had been
> > warned :)
>
> yeah, if somebody would like to tackle rect paint in isometric mode, I
> would be much obliged.

*wonders who that someone he is refering to is*

> > "map_editor" is just a flag that tells the server that the new tags like
> > game.load_start_positions are used. When it loads a game it looks at the
> > flags and from them decides how it will try to load the file.
> > (I hope that was what you asked :) )
>
> here's the code I have issue with:
> server/savegame.c:1810
>
>       if (tmp_server_state==PRE_GAME_STATE
>           && map.generator == 0
>           && !has_capability("map_editor",savefile_options)) {
>         /* generator 0 = map done with map editor */
>         /* aka a "scenario" */
>         if (has_capability("specials",savefile_options)) {
>           map_load(file);
>           map.fixed_start_positions = 1;
>           section_file_check_unused(file, NULL);
>           section_file_free(file);
>           return;
>         }
>         map_tiles_load(file);
>         if (has_capability("riversoverlay",savefile_options)) {
>           map_rivers_overlay_load(file);
>         }
>         if (has_capability("startpos",savefile_options)) {
>           map_startpos_load(file);
>           map.fixed_start_positions = 1;
>           return;
>         }
>         return;
>       }
>     }
>
> first: !has_capability("map_editor",savefile_options)) means that this
> code will never happen normally (unless I hand edit the saved game)
> because 'map_editor' is in the capability string. (should it be
>   has_capability("map_editor"... instead? )
>
> My problem is that I want to make a map that has raw start positions and
> then have map.fixed_start_positions = 1 when I start the game.
>
> Am I reading this right?

You are. That part is legacy compatability crud left in for old savegames 
which don't have the map_editor string. All never saved games has it, of 
course.
You are also correct that there is currently no way to enable 
fixed_start_positions. A simple solution would be to just make it yet another 
saved/loaded option, and that would be completely triviel to implement (in 
fact I will do it in a second). But I think the whole fixed_start_position 
thing is hacky it relies on the sequence of the nations! It would be much 
nicer to allow to attach a list of strings (nation names) to a startpos, 
which the server could then match against the nations. Patches accepted, or I 
may do it myself sometime. :)

> also:
>         map.fixed_start_positions = 1;
> -->     section_file_check_unused(file, NULL);
> -->     section_file_free(file);
>         return;
>
> these two lines need to be removed or we segfault when reentering
> srv_main.c
>
> --mike

done.

-Thue



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