This is the mail archive of the
xconq7@sources.redhat.com
mailing list for the Xconq project.
Cancel plans on revolt
- To: xconq7 at sources dot redhat dot com
- Subject: Cancel plans on revolt
- From: Jim Kingdon <kingdon at panix dot com>
- Date: Mon, 2 Oct 2000 01:31:44 -0400 (EDT)
One annoying feature of the standard game is that when one of the
computer's units revolts to your side, it has a mind of its own (more
specifically it has a plan like "offensive" and it will produce units
according to its own notions rather than being passive.
The enclosed patch fixes that. I tested the case above and the case
in which the unit revolts from one computer polayer to another; both
seemed to work.
2000-10-01 Jim Kingdon <http://sourceforge.net/users/kingdon>
* unit.c (change_unit_side): Cancel the unit's plans when it
changes sides.
Index: kernel/unit.c
===================================================================
RCS file: /cvs/xconq/xconq/kernel/unit.c,v
retrieving revision 1.26
diff -u -r1.26 unit.c
--- unit.c 2000/09/17 18:25:39 1.26
+++ unit.c 2000/10/02 05:28:20
@@ -1330,6 +1330,11 @@
/* A freebie for the unit's previous side. */
see_exact(oldside, ux, uy);
}
+
+ /* The new side gets to decide the unit's new plans. */
+ net_set_unit_plan_type(unit->side, unit, PLAN_NONE);
+ net_clear_task_agenda(unit->side, unit);
+
/* Reflect the changeover in any appropriate displays. */
if (oldside != NULL) {
/* Now we see the unit as belonging to someone else. */