This is the mail archive of the
xconq7@sources.redhat.com
mailing list for the Xconq project.
Patch for player exchange bug
- From: Michele Bini <michele at focuseek dot com>
- To: xconq7 at sources dot redhat dot com
- Date: 09 Apr 2003 19:09:20 +0200
- Subject: Patch for player exchange bug
- Organization: Focuseek.com
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";