forked from github/server
wormhole:
- Kosmetik, Wurmloch verschwindet nach der Reise
This commit is contained in:
parent
cb586eb88e
commit
a0cf754775
|
@ -74,29 +74,25 @@ wormhole_age(struct attrib * a)
|
||||||
{
|
{
|
||||||
wormhole_data * data = (wormhole_data*)a->data.v;
|
wormhole_data * data = (wormhole_data*)a->data.v;
|
||||||
int maxtransport = data->entry->size;
|
int maxtransport = data->entry->size;
|
||||||
|
region * r = data->entry->region;
|
||||||
|
unit * u = r->units;
|
||||||
|
|
||||||
if (data->entry->size==0) {
|
for (;u!=NULL && maxtransport!=0;u=u->next) {
|
||||||
destroy_building(data->entry);
|
message * m;
|
||||||
} else {
|
if (u->number>maxtransport) continue;
|
||||||
region * r = data->entry->region;
|
if (teure_talente(u)) continue;
|
||||||
unit * u = r->units;
|
if (u->building!=data->entry) continue;
|
||||||
|
|
||||||
for (;u!=NULL && maxtransport!=0;u=u->next) {
|
move_unit(u, data->exit->region, NULL);
|
||||||
message * m;
|
maxtransport -= u->number;
|
||||||
if (u->number>maxtransport) continue;
|
m = msg_message("wormhole_exit", "unit region", u, r);
|
||||||
if (teure_talente(u)) continue;
|
add_message(&data->exit->region->msgs, m);
|
||||||
if (u->building!=data->entry) continue;
|
add_message(&u->faction->msgs, m);
|
||||||
|
msg_release(m);
|
||||||
move_unit(u, data->exit->region, NULL);
|
|
||||||
maxtransport -= u->number;
|
|
||||||
m = msg_message("wormhole_exit", "unit region", u, r);
|
|
||||||
add_message(&data->exit->region->msgs, m);
|
|
||||||
add_message(&u->faction->msgs, m);
|
|
||||||
msg_release(m);
|
|
||||||
}
|
|
||||||
data->entry->size = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue