"Wurmloch-Betreten funktioniert nur manchmal"

Fehlermeldung, die das besser erklaert.
This commit is contained in:
Enno Rehling 2007-02-01 17:27:31 +00:00
parent feea3e0039
commit 1762317393
2 changed files with 35 additions and 24 deletions

View File

@ -1,10 +1,10 @@
/* vi: set ts=2: /* vi: set ts=2:
+-------------------+ +-------------------+
| | Christian Schlittchen <corwin@amber.kn-bremen.de> | | Christian Schlittchen <corwin@amber.kn-bremen.de>
| Eressea PBEM host | Enno Rehling <enno@eressea-pbem.de> | Eressea PBEM host | Enno Rehling <enno@eressea-pbem.de>
| (c) 1998 - 2004 | Katja Zedel <katze@felidae.kn-bremen.de> | (c) 1998 - 2004 | Katja Zedel <katze@felidae.kn-bremen.de>
| | | |
+-------------------+ +-------------------+
This program may not be used, modified or distributed This program may not be used, modified or distributed
without prior permission by the authors of Eressea. without prior permission by the authors of Eressea.
@ -53,13 +53,13 @@ typedef struct wormhole_data {
building * exit; building * exit;
} wormhole_data; } wormhole_data;
static void static void
wormhole_init(struct attrib *a) wormhole_init(struct attrib *a)
{ {
a->data.v = calloc(1, sizeof(wormhole_data)); a->data.v = calloc(1, sizeof(wormhole_data));
} }
static void static void
wormhole_done(struct attrib * a) wormhole_done(struct attrib * a)
{ {
free(a->data.v); free(a->data.v);
@ -74,18 +74,20 @@ wormhole_age(struct attrib * a)
unit * u = r->units; unit * u = r->units;
for (;u!=NULL && maxtransport!=0;u=u->next) { for (;u!=NULL && maxtransport!=0;u=u->next) {
message * m; if (u->building==data->entry) {
if (u->number>maxtransport) continue; message * m = NULL;
if (teure_talente(u)) continue; if (u->number>maxtransport || teure_talente(u)) {
if (u->building!=data->entry) continue; m = msg_message("wormhole_requirements", "unit region", u, u->region);
} else if (data->exit!=NULL) {
if (data->exit!=NULL) { move_unit(u, data->exit->region, NULL);
move_unit(u, data->exit->region, NULL); maxtransport -= u->number;
maxtransport -= u->number; m = msg_message("wormhole_exit", "unit region", u, data->exit->region);
m = msg_message("wormhole_exit", "unit region", u, data->exit->region); add_message(&data->exit->region->msgs, m);
add_message(&data->exit->region->msgs, m); }
add_message(&u->faction->msgs, m); if (m!=NULL) {
msg_release(m); add_message(&u->faction->msgs, m);
msg_release(m);
}
} }
} }
@ -99,7 +101,7 @@ wormhole_age(struct attrib * a)
return -1; return -1;
} }
static void static void
wormhole_write(const struct attrib * a, FILE* F) wormhole_write(const struct attrib * a, FILE* F)
{ {
wormhole_data * data = (wormhole_data*)a->data.v; wormhole_data * data = (wormhole_data*)a->data.v;
@ -119,11 +121,11 @@ wormhole_read(struct attrib * a, FILE* F)
} }
static attrib_type at_wormhole = { static attrib_type at_wormhole = {
"wormhole", "wormhole",
wormhole_init, wormhole_init,
wormhole_done, wormhole_done,
wormhole_age, wormhole_age,
wormhole_write, wormhole_write,
wormhole_read, wormhole_read,
ATF_UNIQUE ATF_UNIQUE
}; };
@ -145,7 +147,7 @@ make_wormhole(const building_type * bt_wormhole, region * r1, region * r2)
ADDMSG(&r2->msgs, msg_message("wormhole_appear", "region", r2)); ADDMSG(&r2->msgs, msg_message("wormhole_appear", "region", r2));
} }
void void
create_wormholes(void) create_wormholes(void)
{ {
#define WORMHOLE_CHANCE 10000 #define WORMHOLE_CHANCE 10000
@ -190,7 +192,7 @@ create_wormholes(void)
} }
} }
void void
register_wormholes(void) register_wormholes(void)
{ {
at_register(&at_wormhole); at_register(&at_wormhole);

View File

@ -6184,6 +6184,15 @@
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - No pyramids may be build in this region. The closest region to build a pyramid in is between $int($mindist) and $int($maxdist) regions away."</text> <text locale="en">"$unit($unit) in $region($region): '$order($command)' - No pyramids may be build in this region. The closest region to build a pyramid in is between $int($mindist) and $int($maxdist) regions away."</text>
<text locale="fr">"$unit($unit) in $region($region): '$order($command)' - No pyramids may be build in this region. The closest region to build a pyramid in is between $int($mindist) and $int($maxdist) regions away."</text> <text locale="fr">"$unit($unit) in $region($region): '$order($command)' - No pyramids may be build in this region. The closest region to build a pyramid in is between $int($mindist) and $int($maxdist) regions away."</text>
</message> </message>
<message name="wormhole_requirements" section="events">
<type>
<arg name="unit" type="unit"/>
<arg name="region" type="region"/>
</type>
<text locale="de">"$unit($unit) kann in $region($region) nicht durch das Wurmloch reisen, da die Einheit entweder zu gross ist oder teure Talente besitzt."</text>
<text locale="fr">"$unit($unit) cannot travel through the wormhole in $region($region) because the unit is either too big or has restricted skills."</text>
<text locale="en">"$unit($unit) cannot travel through the wormhole in $region($region) because the unit is either too big or has restricted skills."</text>
</message>
<message name="wormhole_exit" section="events"> <message name="wormhole_exit" section="events">
<type> <type>
<arg name="unit" type="unit"/> <arg name="unit" type="unit"/>