give player an error message when a message is missing.

This commit is contained in:
Enno Rehling 2007-05-28 19:53:52 +00:00
parent 54446e0a1e
commit b5d6b0876e
2 changed files with 20 additions and 3 deletions

View File

@ -88,7 +88,7 @@ msg_feedback(const struct unit * u, struct order * ord, const char * name, const
if (!mtype) { if (!mtype) {
log_error(("trying to create message of unknown type \"%s\"\n", name)); log_error(("trying to create message of unknown type \"%s\"\n", name));
return NULL; return msg_message("missing_feedback", "unit region command name", u, u->region, ord, name);
} }
var.v = (void*)u; var.v = (void*)u;
@ -141,8 +141,8 @@ msg_message(const char * name, const char* sig, ...)
memset(args, 0, sizeof(args)); memset(args, 0, sizeof(args));
if (!mtype) { if (!mtype) {
log_warning(("trying to create message of unknown type \"%s\"\n", name)); log_error(("trying to create message of unknown type \"%s\"\n", name));
return NULL; return msg_message("missing_message", "name", name);
} }
va_start(marker, sig); va_start(marker, sig);

View File

@ -523,6 +523,23 @@
<text locale="fr">"$unit($unit) sets a solar sail. The ship's speed is increased by $int($speed)."</text> <text locale="fr">"$unit($unit) sets a solar sail. The ship's speed is increased by $int($speed)."</text>
<text locale="en">"$unit($unit) sets a solar sail. The ship's speed is increased by $int($speed)."</text> <text locale="en">"$unit($unit) sets a solar sail. The ship's speed is increased by $int($speed)."</text>
</message> </message>
<message name="missing_message" section="errors">
<type>
<arg name="name" type="string"/>
</type>
<text locale="de">"Interner Fehler: Meldung '$name' nicht definiert."</text>
<text locale="en">"Internal Error: Message '$name' is undefined."</text>
</message>
<message name="missing_feedback" section="errors">
<type>
<arg name="region" type="region"/>
<arg name="unit" type="unit"/>
<arg name="command" type="order"/>
<arg name="name" type="string"/>
</type>
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - Interner Fehler: Meldung '$name' nicht definiert."</text>
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - Internal Error: Message '$name' is undefined."</text>
</message>
<message name="use_questkey_wrongregion" section="events"> <message name="use_questkey_wrongregion" section="events">
<type> <type>
<arg name="region" type="region"/> <arg name="region" type="region"/>