forked from github/server
"Merkwürdige Fehlermeldung bei Delphin" Neue Message-Funktion, die den Terraintyp einer Region ausgibt.
This commit is contained in:
parent
5317da7512
commit
9f146d1a07
|
@ -2922,6 +2922,19 @@ eval_region(struct opstack ** stack, const void * userdata) /* region -> string
|
||||||
opush(stack, var);
|
opush(stack, var);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
eval_terrain(struct opstack ** stack, const void * userdata) /* region -> string */
|
||||||
|
{
|
||||||
|
const struct faction * f = (const struct faction *)userdata;
|
||||||
|
const struct region * r = (const struct region *)opop(stack).v;
|
||||||
|
const char * c = LOC(f->locale, terrain_name(r));
|
||||||
|
size_t len = strlen(c);
|
||||||
|
variant var;
|
||||||
|
|
||||||
|
var.v = strcpy(balloc(len+1), c);
|
||||||
|
opush(stack, var);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
eval_ship(struct opstack ** stack, const void * userdata) /* ship -> string */
|
eval_ship(struct opstack ** stack, const void * userdata) /* ship -> string */
|
||||||
{
|
{
|
||||||
|
@ -3091,6 +3104,7 @@ report_init(void)
|
||||||
/* register functions that turn message contents to readable strings */
|
/* register functions that turn message contents to readable strings */
|
||||||
add_function("alliance", &eval_alliance);
|
add_function("alliance", &eval_alliance);
|
||||||
add_function("region", &eval_region);
|
add_function("region", &eval_region);
|
||||||
|
add_function("terrain", &eval_terrain);
|
||||||
add_function("weight", &eval_weight);
|
add_function("weight", &eval_weight);
|
||||||
add_function("resource", &eval_resource);
|
add_function("resource", &eval_resource);
|
||||||
add_function("race", &eval_race);
|
add_function("race", &eval_race);
|
||||||
|
|
|
@ -1969,18 +1969,18 @@
|
||||||
<arg name="unit" type="unit"/>
|
<arg name="unit" type="unit"/>
|
||||||
<arg name="direction" type="direction"/>
|
<arg name="direction" type="direction"/>
|
||||||
</type>
|
</type>
|
||||||
<text locale="de">"$unit($unit) entdeckt dass im $direction($direction) Ozean ist."</text>
|
<text locale="de">"$unit($unit) entdeckt dass im $direction($direction) $terrain($region) ist."</text>
|
||||||
<text locale="fr">"$unit($unit) discovered that an Ocean lies in the $direction($direction)."</text>
|
<text locale="fr">"$unit($unit) discovered that an ocean lies in the $direction($direction)."</text>
|
||||||
<text locale="en">"$unit($unit) discovered that an Ocean lies in the $direction($direction)."</text>
|
<text locale="en">"$unit($unit) discovered that an ocean lies in the $direction($direction)."</text>
|
||||||
</message>
|
</message>
|
||||||
<message name="detectocean" section="movement">
|
<message name="detectocean" section="movement">
|
||||||
<type>
|
<type>
|
||||||
<arg name="unit" type="unit"/>
|
<arg name="unit" type="unit"/>
|
||||||
<arg name="region" type="region"/>
|
<arg name="region" type="region"/>
|
||||||
</type>
|
</type>
|
||||||
<text locale="de">"$unit($unit) entdeckt, dass $region($region) Ozean ist."</text>
|
<text locale="de">"$unit($unit) entdeckt, dass $region($region) $terrain($region) ist."</text>
|
||||||
<text locale="fr">"$unit($unit) discovered that $region($region) is Ocean."</text>
|
<text locale="fr">"$unit($unit) discovered that $region($region) is $terrain($region)."</text>
|
||||||
<text locale="en">"$unit($unit) discovered that $region($region) is Ocean."</text>
|
<text locale="en">"$unit($unit) discovered that $region($region) is $terrain($region)."</text>
|
||||||
</message>
|
</message>
|
||||||
<message name="sailnolandingstorm" section="movement">
|
<message name="sailnolandingstorm" section="movement">
|
||||||
<type>
|
<type>
|
||||||
|
|
Loading…
Reference in New Issue