This is the mail archive of the
xconq7@sources.redhat.com
mailing list for the Xconq project.
Re: Cancel plans on revolt
> Actually, I think we need to run init_unit_plan to clear the whole
> plan; otherwise properties like aicontrol, formation, etc, are left
> untouched, with interesting, if undesired, consequences...
OK, here's a new patch. This one seems to work on the test case I
tried, although I didn't test it quite as much as the last one.
2000-10-02 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/03 07:04:38
@@ -1330,6 +1330,10 @@
/* A freebie for the unit's previous side. */
see_exact(oldside, ux, uy);
}
+
+ /* The new side gets to decide the unit's new plans. */
+ init_unit_plan (unit);
+
/* Reflect the changeover in any appropriate displays. */
if (oldside != NULL) {
/* Now we see the unit as belonging to someone else. */