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: Thue <thue@xxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: new civworld patch
From: Mike Kaufman <mkaufman@xxxxxxxxxxxxxx>
Date: Tue, 20 Feb 2001 16:32:40 -0600 (CST)


> 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.

> 
> "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?

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




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