This is the mail archive of the
xconq7@sources.redhat.com
mailing list for the Xconq project.
Allow completing partial builds even if numtypes > 1
- To: xconq7 at sources dot redhat dot com
- Subject: Allow completing partial builds even if numtypes > 1
- From: Jim Kingdon <kingdon at panix dot com>
- Date: Tue, 10 Apr 2001 00:40:42 -0400 (EDT)
The enclosed patch fixes an inconsistency between the case in which a
unit has one possible unit they can build, and in which it can build
multiple types.
In the former case (with or without the patch), a unit can work on
completing a partially built unit in which it is located. This is
useful: (1) if the unit which began building it is gone (ran out of
material or was destroyed in combat), (2) to build the containing unit
faster by having multiple building units.
In the latter case without the patch, a unit cannot complete a
partially built unit which it didn't start. If the unit which began
building is gone, you need to disband the partially built unit and
start over. With the patch, the behavior is similar to the former
case.
2001-04-07 Jim Kingdon <kingdon@panix.com>
* tcltk/tkcmd.c (do_build): Let a unit finish building its
transport even if numtypes > 1.
Index: tkcmd.c
===================================================================
RCS file: /cvs/xconq/xconq/tcltk/tkcmd.c,v
retrieving revision 1.50
diff -u -r1.50 tkcmd.c
--- tkcmd.c 2001/02/01 02:38:27 1.50
+++ tkcmd.c 2001/04/10 04:35:11
@@ -304,8 +304,7 @@
}
if (unit->transport != NULL
&& !uu_occ_can_build(unit->transport->type, u)
- && !(numtypes == 1
- && !completed(unit->transport)
+ && !(!completed(unit->transport)
&& uu_acp_to_build(u, unit->transport->type) > 0)) {
cmd_error(side, "%s can't build anything while inside another unit!",
unit_handle(side, unit));
@@ -331,9 +330,19 @@
}
break;
default:
- /* Player has to choose a type to build. */
- map->argunitid = unit->id;
- ask_unit_type(side, map, "Type to build:", tmp_u_array, aux_build);
+ if (unit->transport != NULL
+ && !completed(unit->transport)) {
+ /* Kind of icky to assume that they want to build here
+ rather than elsewhere, but the code above which checks
+ for occupancy does the same. Not sure about the right
+ solution. */
+ impl_build(side, unit, unit->transport->type,
+ unit->x, unit->y, map->prefixarg);
+ } else {
+ /* Player has to choose a type to build. */
+ map->argunitid = unit->id;
+ ask_unit_type(side, map, "Type to build:", tmp_u_array, aux_build);
+ }
break;
}
}