Implemented the transport action for the wormhole. up to 4 people, no mages or other expensive skills.

This commit is contained in:
Enno Rehling 2004-02-21 22:37:47 +00:00
parent 8a57319cd2
commit 016a209845
1 changed files with 12 additions and 0 deletions

View File

@ -72,6 +72,18 @@ static int
wormhole_age(struct attrib * a) wormhole_age(struct attrib * a)
{ {
wormhole_data * data = (wormhole_data*)a->data.v; wormhole_data * data = (wormhole_data*)a->data.v;
region * r = data->entry->region;
unit * u = r->units;
int maxtransport = 4;
for (;u!=NULL && maxtransport!=0;u=u->next) {
if (u->number>maxtransport) continue;
if (teure_talente(u)) continue;
if (u->building!=data->entry) continue;
move_unit(u, data->exit->region, NULL);
maxtransport -= u->number;
}
destroy_building(data->entry); destroy_building(data->entry);
/* age returns 0 if the attribute needs to be removed, !=0 otherwise */ /* age returns 0 if the attribute needs to be removed, !=0 otherwise */
return -1; return -1;