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

2008/7/20 Marko Lindqvist:
> Client is crashing because
> phase number is considered to be same as number of active player and
> 32 is illegal player number.

> now I looked it, it seems to be
> almost trivial to fix

 Like this.


 - ML

diff -Nurd -X.diff_ignore freeciv/client/text.c freeciv/client/text.c
--- freeciv/client/text.c       2008-01-22 03:47:26.000000000 +0200
+++ freeciv/client/text.c       2008-07-20 07:16:32.000000000 +0300
@@ -603,8 +603,12 @@
                  game.player_ptr->economic.science);
   }
   if (!game.info.simultaneous_phases) {
-    astr_add_line(&str, _("Moving: %s"),
-                 player_name(player_by_number(game.info.phase)));
+    if (game.info.phase < 0 || game.info.phase >= game.info.nplayers) {
+      astr_add_line(&str, _("Moving: Nobody"));
+    } else {
+      astr_add_line(&str, _("Moving: %s"),
+                    player_name(player_by_number(game.info.phase)));
+    }
   }
   astr_add_line(&str, _("(Click for more info)"));
   return str.str;
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to