forked from github/server
Implemented the transport action for the wormhole. up to 4 people, no mages or other expensive skills.
This commit is contained in:
parent
8a57319cd2
commit
016a209845
|
@ -72,6 +72,18 @@ static int
|
|||
wormhole_age(struct attrib * a)
|
||||
{
|
||||
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);
|
||||
/* age returns 0 if the attribute needs to be removed, !=0 otherwise */
|
||||
return -1;
|
||||
|
|
Loading…
Reference in New Issue