From 016a209845d0b605030b65d26813319ddd449667 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 21 Feb 2004 22:37:47 +0000 Subject: [PATCH] Implemented the transport action for the wormhole. up to 4 people, no mages or other expensive skills. --- src/common/modules/wormhole.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/common/modules/wormhole.c b/src/common/modules/wormhole.c index f577ac66d..352abc95c 100644 --- a/src/common/modules/wormhole.c +++ b/src/common/modules/wormhole.c @@ -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;