Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2004:
[Freeciv-Dev] (PR#7265) unexpected exit from tabular at u4.id
Home

[Freeciv-Dev] (PR#7265) unexpected exit from tabular at u4.id

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: chrisk@xxxxxxxxx, mikon@xxxxxxxxxxxx, mortmann@xxxxxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#7265) unexpected exit from tabular at u4.id
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 22 Feb 2004 21:44:12 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=7265 >

> [jdorje - Mon Jan 19 08:32:33 2004]:
> 
> I get this message
> 
>    unexpected exit from tabular at u4.id
> 
> when saving a game under the orders patch.

I believe this patch fixes it.

When some units get orders entries in the savegame and some don't, the
registry's nicely formatted list

  unit1 = {"a", "b", "c"}

doesn't work because the fields aren't the same for all units.  Thus the
registry code gets confused and falls back to an inferior method:

  unit1.index = "a"
  unit1.orders = "b"
  unit1.repeat = "c"

This is probably a bug in the registry code, since it could just as
easily leave the fields blank.

  unit1 = {,,}

I'm not about to touch the registry code.

jason

Index: server/savegame.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/savegame.c,v
retrieving revision 1.147
diff -u -r1.147 savegame.c
--- server/savegame.c   2004/02/18 22:26:46     1.147
+++ server/savegame.c   2004/02/23 05:41:41
@@ -1589,7 +1589,18 @@
       secfile_insert_str(file, dir_buf,
                         "player%d.u%d.dir_list", plrno, i);
     } else {
+      /* Put all the same fields into the savegame.  Otherwise the
+       * registry code gets confused (although it still works). */
       secfile_insert_int(file, 0, "player%d.u%d.orders_length", plrno, i);
+      secfile_insert_int(file, 0, "player%d.u%d.orders_index", plrno, i);
+      secfile_insert_bool(file, FALSE,
+                         "player%d.u%d.orders_repeat", plrno, i);
+      secfile_insert_bool(file, FALSE,
+                         "player%d.u%d.orders_vigilant", plrno, i);
+      secfile_insert_str(file, "-",
+                        "player%d.u%d.orders_list", plrno, i);
+      secfile_insert_str(file, "-",
+                        "player%d.u%d.dir_list", plrno, i);
     }
   }
   unit_list_iterate_end;

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