This is the mail archive of the
xconq7@sources.redhat.com
mailing list for the Xconq project.
garrison_unit?
- From: "Stanley Sutton" <sutton at t-surf dot com>
- To: <xconq7 at sources dot redhat dot com>
- Date: Thu, 1 Aug 2002 09:01:21 -0500
- Subject: garrison_unit?
As near as I can tell, there is a dead branch in the code:
Unit *transport = NULL, *occ, *nextocc;
/* Maybe get rid of the building unit if it is to be the garrison.
*/
if (uu_hp_to_garrison(u, u2) >= unit->hp) {
/* But first get the about-to-be-killed garrisoning unit
disconnected from everything. */
leave_cell(unit);
/* Put new unit in place of the garrisoning one, if it was an
occupant. */
if (unit2->transport == unit) {
leave_transport(unit2);
if (transport != NULL) { /* some other unit that could be
transport? */
enter_transport(unit2, transport);
} else {
enter_cell(unit2, x, y);
}
The line 'if (transport != NULL) {' will always take the 2nd branch
unless there is a side effect that I can't find. If there is a reason
for the code, I'd like to document it.