forked from github/server
feedback_unit_not_found used throughout instead of error 63 or German text
This commit is contained in:
parent
5c75304747
commit
8e92559dae
|
@ -570,7 +570,6 @@ give_cmd(unit * u, order * ord)
|
|||
const char *s;
|
||||
int i, n;
|
||||
const item_type * itype;
|
||||
int notfound_error = 63;
|
||||
param_t p;
|
||||
|
||||
init_tokens(ord);
|
||||
|
@ -578,13 +577,13 @@ give_cmd(unit * u, order * ord)
|
|||
u2 = getunit(r, u->faction);
|
||||
|
||||
if (!u2 && !getunitpeasants) {
|
||||
cmistake(u, ord, notfound_error, MSG_COMMERCE);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
return;
|
||||
}
|
||||
|
||||
/* Damit Tarner nicht durch die Fehlermeldung enttarnt werden können */
|
||||
if (u2 && !alliedunit(u2, u->faction, HELP_GIVE) && !cansee(u->faction,r,u2,0) && !ucontact(u2, u) && !fval(u2, UFL_TAKEALL)) {
|
||||
cmistake(u, ord, notfound_error, MSG_COMMERCE);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
return;
|
||||
}
|
||||
if (u == u2) {
|
||||
|
@ -604,7 +603,7 @@ give_cmd(unit * u, order * ord)
|
|||
|
||||
if (p == P_CONTROL) {
|
||||
if (!u2) {
|
||||
cmistake(u, ord, notfound_error, MSG_EVENT);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
return;
|
||||
}
|
||||
if (!u->building && !u->ship) {
|
||||
|
@ -641,7 +640,7 @@ give_cmd(unit * u, order * ord)
|
|||
}
|
||||
|
||||
else if (u2 && u2->race == new_race[RC_SPELL]) {
|
||||
cmistake(u, ord, notfound_error, MSG_COMMERCE);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -674,7 +673,7 @@ give_cmd(unit * u, order * ord)
|
|||
}
|
||||
if (!u2) {
|
||||
if (!getunitpeasants) {
|
||||
cmistake(u, ord, notfound_error, MSG_COMMERCE);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -2725,7 +2724,7 @@ steal_cmd(unit * u, struct order * ord, request ** stealorders)
|
|||
}
|
||||
|
||||
if (!u2) {
|
||||
cmistake(u, ord, 63, MSG_INCOME);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1690,7 +1690,7 @@ name_cmd(unit * u, struct order * ord)
|
|||
unit *u2 = getunit(r, u->faction);
|
||||
|
||||
if (!u2 || !cansee(u->faction, r, u2, 0)) {
|
||||
cmistake(u, ord, 63, MSG_EVENT);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
break;
|
||||
} else {
|
||||
const char * udefault = LOC(u2->faction->locale, "unitdefault");
|
||||
|
@ -1801,7 +1801,7 @@ mailunit(region * r, unit * u, int n, struct order * ord, const char * s)
|
|||
else {
|
||||
/* Immer eine Meldung - sonst könnte man so getarnte EHs enttarnen:
|
||||
* keine Meldung -> EH hier. */
|
||||
cmistake(u, ord, 63, MSG_MESSAGE);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1889,7 +1889,7 @@ mail_cmd(unit * u, struct order * ord)
|
|||
}
|
||||
|
||||
if (see == false) {
|
||||
cmistake(u, ord, 63, MSG_MESSAGE);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2806,7 +2806,7 @@ evict(void)
|
|||
|
||||
if (u2==NULL) {
|
||||
/* Einheit nicht gefunden */
|
||||
cmistake(u,ord,63,MSG_EVENT);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -3718,7 +3718,7 @@ init_battle(region * r, battle **bp)
|
|||
/* Beginn Fehlerbehandlung */
|
||||
/* Fehler: "Die Einheit wurde nicht gefunden" */
|
||||
if (!u2 || u2->number == 0 || !cansee(u->faction, u->region, u2, 0)) {
|
||||
cmistake(u, ord, 63, MSG_BATTLE);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
continue;
|
||||
}
|
||||
/* Fehler: "Die Einheit ist eine der unsrigen" */
|
||||
|
|
|
@ -328,7 +328,7 @@ give_unit(unit * u, unit * u2, order * ord)
|
|||
give_men(u->number, u, NULL, ord);
|
||||
cmistake(u, ord, 153, MSG_COMMERCE);
|
||||
} else {
|
||||
cmistake(u, ord, 63, MSG_COMMERCE);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1077,7 +1077,7 @@ use_foolpotion(struct unit *u, int targetno, const struct item_type *itype, int
|
|||
{
|
||||
unit * target = findunit(targetno);
|
||||
if (target==NULL || u->region!=target->region) {
|
||||
cmistake(u, ord, 63, MSG_EVENT);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
return ECUSTOM;
|
||||
}
|
||||
if (effskill(u, SK_STEALTH)<=effskill(target, SK_OBSERVATION)) {
|
||||
|
|
|
@ -991,14 +991,14 @@ init_transportation(void)
|
|||
skip_token();
|
||||
ut = getunit(r, u->faction);
|
||||
if (ut == NULL) {
|
||||
cmistake(u, u->thisorder, 63, MSG_MOVE);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, u->thisorder, "feedback_unit_not_found", ""));
|
||||
continue;
|
||||
}
|
||||
if (!transport(ut, u)) {
|
||||
if (cansee(u->faction, r, ut, 0)) {
|
||||
cmistake(u, u->thisorder, 286, MSG_MOVE);
|
||||
} else {
|
||||
cmistake(u, u->thisorder, 63, MSG_MOVE);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, u->thisorder, "feedback_unit_not_found", ""));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1963,14 +1963,14 @@ travel_i(unit * u, region_list * route_begin, region_list * route_end, order * o
|
|||
if (cansee(u->faction, u->region, ut, 0)) {
|
||||
cmistake(u, ord, 90, MSG_MOVE);
|
||||
} else {
|
||||
cmistake(u, ord, 63, MSG_MOVE);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
cmistake(u, ord, 99, MSG_MOVE);
|
||||
}
|
||||
} else {
|
||||
cmistake(u, ord, 63, MSG_MOVE);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
}
|
||||
}
|
||||
return route_end;
|
||||
|
|
|
@ -207,7 +207,7 @@ spy_cmd(unit * u, struct order * ord)
|
|||
target = getunit(r, u->faction);
|
||||
|
||||
if (!target) {
|
||||
cmistake(u, u->thisorder, 63, MSG_EVENT);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, u->thisorder, "feedback_unit_not_found", ""));
|
||||
return 0;
|
||||
}
|
||||
if (!can_contact(r, u, target)) {
|
||||
|
|
|
@ -249,7 +249,7 @@ gm_teleport(const tnode * tnext, const char * str, void * data, struct order * o
|
|||
if (r==NULL || p!=rplane(r)) {
|
||||
mistake(u, ord, "In diese Region kann die Einheit nicht teleportieren.", 0);
|
||||
} else if (to==NULL) {
|
||||
cmistake(u, ord, 63, MSG_MAGIC);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
} else if (rplane(to->region)!=rplane(r) && !ucontact(to, u)) {
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_no_contact", "target", to));
|
||||
} else {
|
||||
|
@ -433,7 +433,7 @@ gm_messageunit(const tnode * tnext, const char * str, void * data, struct order
|
|||
region * r;
|
||||
|
||||
if (target == NULL) {
|
||||
cmistake(u, ord, 63, MSG_EVENT);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -468,7 +468,7 @@ gm_give(const tnode * tnext, const char * str, void * data, struct order * ord)
|
|||
|
||||
if (to==NULL || rplane(to->region) != rplane(u->region)) {
|
||||
/* unknown or in another plane */
|
||||
mistake(u, ord, "Die Einheit wurde nicht gefunden.", 0);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
} else if (itype==NULL || i_get(u->items, itype)==0) {
|
||||
/* unknown or not enough */
|
||||
mistake(u, ord, "So einen Gegenstand hat die Einheit nicht.", 0);
|
||||
|
@ -503,7 +503,7 @@ gm_take(const tnode * tnext, const char * str, void * data, struct order * ord)
|
|||
|
||||
if (to==NULL || rplane(to->region) != rplane(u->region)) {
|
||||
/* unknown or in another plane */
|
||||
mistake(u, ord, "Die Einheit wurde nicht gefunden.", 0);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
} else if (itype==NULL || i_get(to->items, itype)==0) {
|
||||
/* unknown or not enough */
|
||||
mistake(u, ord, "So einen Gegenstand hat die Einheit nicht.", 0);
|
||||
|
@ -538,7 +538,7 @@ gm_skill(const tnode * tnext, const char * str, void * data, struct order * ord)
|
|||
|
||||
if (to==NULL || rplane(to->region) != rplane(u->region)) {
|
||||
/* unknown or in another plane */
|
||||
mistake(u, ord, "Die Einheit wurde nicht gefunden.", 0);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
} else if (skill==NOSKILL || skill==SK_MAGIC || skill==SK_ALCHEMY) {
|
||||
/* unknown or not enough */
|
||||
mistake(u, ord, "Dieses Talent ist unbekannt, oder kann nicht erhöht werden.", 0);
|
||||
|
|
|
@ -51,7 +51,7 @@ xe_givelaen(unit *u, struct order * ord)
|
|||
unit *u2 =getunitg(u->region, u->faction);
|
||||
|
||||
if(!u2) {
|
||||
cmistake(u, ord, 63, MSG_EVENT);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
return;
|
||||
}
|
||||
i_change(&u2->items, olditemtype[I_LAEN], 5);
|
||||
|
@ -63,7 +63,7 @@ xe_givepotion(unit *u, struct order *ord)
|
|||
unit *u2 =getunitg(u->region, u->faction);
|
||||
|
||||
if(!u2) {
|
||||
cmistake(u, ord, 63, MSG_EVENT);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
return;
|
||||
}
|
||||
i_change(&u2->items, it_find("skillpotion"), 1);
|
||||
|
@ -76,7 +76,7 @@ xe_giveballon(unit *u, struct order *ord)
|
|||
ship *sh;
|
||||
|
||||
if(!u2) {
|
||||
cmistake(u, ord, 63, MSG_EVENT);
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", ""));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -5325,9 +5325,8 @@ sp_dreamreading(castorder *co)
|
|||
}
|
||||
|
||||
/* Entfernung */
|
||||
if(distance(mage->region, u->region) > power) {
|
||||
addmessage(r, mage->faction, "Die Einheit ist zu weit "
|
||||
"entfernt.", MSG_MAGIC, ML_MISTAKE);
|
||||
if (distance(mage->region, u->region) > power) {
|
||||
ADDMSG(&mage->faction->msgs, msg_feedback(mage, co->order, "spellfail_distance", ""));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -5983,8 +5982,7 @@ sp_fetchastral(castorder *co)
|
|||
}
|
||||
|
||||
if (is_cursed(rt->attribs, C_ASTRALBLOCK, 0)) {
|
||||
ADDMSG(&mage->faction->msgs, msg_message("spellfail_distance",
|
||||
"command region unit", co->order, rt, mage));
|
||||
ADDMSG(&mage->faction->msgs, msg_feedback(mage, co->order, "spellfail_distance", ""));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -5307,7 +5307,7 @@
|
|||
<text locale="fr">"$unit($unit) in $region($region): '$order($command)' - $unit($unit) is not sufficiently stealthy."</text>
|
||||
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - $unit($unit) is not sufficiently stealthy."</text>
|
||||
</message>
|
||||
<message name="error63" section="errors">
|
||||
<message name="feedback_unit_not_found" section="errors">
|
||||
<type>
|
||||
<arg name="unit" type="unit"/>
|
||||
<arg name="region" type="region"/>
|
||||
|
@ -6495,8 +6495,8 @@
|
|||
<arg name="unit" type="unit"/>
|
||||
<arg name="target" type="unit"/>
|
||||
</type>
|
||||
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - $unit($target) ist zu weit entfernt."</text>
|
||||
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - $unit($target) is too far away."</text>
|
||||
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - Die Region ist zu weit entfernt."</text>
|
||||
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - That region is too far away."</text>
|
||||
</message>
|
||||
|
||||
<message name="spellfail_block" section="errors">
|
||||
|
|
Loading…
Reference in New Issue