This is the mail archive of the xconq7@sources.redhat.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch for player exchange bug


In the panzer game (and in every game with no independent side as well,
AFAIK) xconq crashes when I try to exchange players.

The attached patch fixes the problem.

diff --recursive -uB xconq.orig/kernel/init.c xconq/kernel/init.c
--- xconq.orig/kernel/init.c	Wed Apr  9 14:11:01 2003
+++ xconq/kernel/init.c	Wed Apr  9 19:02:51 2003
@@ -1049,12 +1049,14 @@
     /* Toggle the Jolly Roger on or off if the indepside gains or loses
     control by a human or an ai. However, always keep a flag that was
     assigned by the game module. */ 
-    if (empty_string(indepside->player->aitypename)
+    if (indepside->player
+       && empty_string(indepside->player->aitypename)
        && empty_string(indepside->player->displayname)
        && strcmp("flag-pirate", indepside->emblemname) == 0) {
     	indepside->emblemname = "none";
     }
-    if ((!empty_string(indepside->player->aitypename)
+    if (indepside->player
+       && (!empty_string(indepside->player->aitypename)
     	|| !empty_string(indepside->player->displayname))
     	&& strcmp("none", indepside->emblemname) == 0) {
     	indepside->emblemname = "flag-pirate";

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]