garrison_unit?
Lincoln Peters
peters2000@mindspring.com
Thu Aug 1 17:45:00 GMT 2002
I suspect that this branch is used by time.g so that when a city is
upgraded, all of its occupants are transferred into the new city instead
of vanishing along with the old city. Although I'm not sure.
On Thu, 2002-08-01 at 07:01, Stanley Sutton wrote:
> 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.
>
More information about the Xconq7
mailing list