<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39514 >

On 09/08/07, William Allen Simpson <[EMAIL PROTECTED]> wrote:
>
> New behavior: r13215 trunk loading my standard test game (generated in 2.1),
> all existing nations are declared invalid:

 Oops. Should have tested better after simplifying #39485.

 I'll commit attached fix as soon as I have tested it.


 - ML

diff -Nurd -X.diff_ignore freeciv/server/barbarian.c freeciv/server/barbarian.c
--- freeciv/server/barbarian.c	2007-08-04 18:36:24.000000000 +0300
+++ freeciv/server/barbarian.c	2007-08-09 17:08:04.000000000 +0300
@@ -68,7 +68,7 @@
 /**************************************************************************
   Is player a sea barbarian?
 **************************************************************************/
-static bool is_sea_barbarian(struct player *pplayer)
+bool is_sea_barbarian(struct player *pplayer)
 {
   return (pplayer->ai.barbarian_type == SEA_BARBARIAN);
 }
diff -Nurd -X.diff_ignore freeciv/server/barbarian.h freeciv/server/barbarian.h
--- freeciv/server/barbarian.h	2007-08-04 18:36:24.000000000 +0300
+++ freeciv/server/barbarian.h	2007-08-09 17:07:53.000000000 +0300
@@ -32,5 +32,6 @@
 bool unleash_barbarians(struct tile *ptile);
 void summon_barbarians(void);
 bool is_land_barbarian(struct player *pplayer);
+bool is_sea_barbarian(struct player *pplayer);
 
 #endif  /* FC__BARBARIAN_H */
diff -Nurd -X.diff_ignore freeciv/server/savegame.c freeciv/server/savegame.c
--- freeciv/server/savegame.c	2007-08-09 00:00:44.000000000 +0300
+++ freeciv/server/savegame.c	2007-08-09 17:08:18.000000000 +0300
@@ -1923,7 +1923,7 @@
      * Reassign correct nations for such barbarians. */
     enum barbarian_type nat_barb_type = nation_barbarian_type(pnation);
 
-    if ((!is_land_barbarian(plr) && nat_barb_type != SEA_BARBARIAN)
+    if ((is_sea_barbarian(plr) && nat_barb_type != SEA_BARBARIAN)
         || (is_land_barbarian(plr) && nat_barb_type != LAND_BARBARIAN)) {
       freelog(LOG_ERROR, "Reassigning barbarian nation for %s", plr->name);
       plr->nation = NO_NATION_SELECTED;
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to