From 8e92559daecaf34543113db553ef1f3f8860eb47 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 10 Feb 2007 21:47:51 +0000 Subject: [PATCH] feedback_unit_not_found used throughout instead of error 63 or German text --- src/common/gamecode/economy.c | 13 ++++++------- src/common/gamecode/laws.c | 8 ++++---- src/common/kernel/battle.c | 2 +- src/common/kernel/give.c | 2 +- src/common/kernel/item.c | 2 +- src/common/kernel/movement.c | 8 ++++---- src/common/kernel/spy.c | 2 +- src/common/modules/gmcmd.c | 10 +++++----- src/common/modules/xecmd.c | 6 +++--- src/common/spells/spells.c | 10 ++++------ src/res/messages.xml | 6 +++--- 11 files changed, 33 insertions(+), 36 deletions(-) diff --git a/src/common/gamecode/economy.c b/src/common/gamecode/economy.c index be0b553cc..ca95ad4f0 100644 --- a/src/common/gamecode/economy.c +++ b/src/common/gamecode/economy.c @@ -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; } diff --git a/src/common/gamecode/laws.c b/src/common/gamecode/laws.c index e93adf228..0fcae4d14 100644 --- a/src/common/gamecode/laws.c +++ b/src/common/gamecode/laws.c @@ -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; } diff --git a/src/common/kernel/battle.c b/src/common/kernel/battle.c index b7bfa385e..b3b7311eb 100644 --- a/src/common/kernel/battle.c +++ b/src/common/kernel/battle.c @@ -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" */ diff --git a/src/common/kernel/give.c b/src/common/kernel/give.c index ad27ab234..bb59b160c 100644 --- a/src/common/kernel/give.c +++ b/src/common/kernel/give.c @@ -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; } diff --git a/src/common/kernel/item.c b/src/common/kernel/item.c index 02ee1a7c4..8eae794f8 100644 --- a/src/common/kernel/item.c +++ b/src/common/kernel/item.c @@ -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)) { diff --git a/src/common/kernel/movement.c b/src/common/kernel/movement.c index c62a9e20b..c4d9b964f 100644 --- a/src/common/kernel/movement.c +++ b/src/common/kernel/movement.c @@ -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; diff --git a/src/common/kernel/spy.c b/src/common/kernel/spy.c index b313f2bd6..4a5b0bb10 100644 --- a/src/common/kernel/spy.c +++ b/src/common/kernel/spy.c @@ -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)) { diff --git a/src/common/modules/gmcmd.c b/src/common/modules/gmcmd.c index b5cac117f..ac54a30d7 100644 --- a/src/common/modules/gmcmd.c +++ b/src/common/modules/gmcmd.c @@ -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); diff --git a/src/common/modules/xecmd.c b/src/common/modules/xecmd.c index d5bc3a695..60a12897c 100644 --- a/src/common/modules/xecmd.c +++ b/src/common/modules/xecmd.c @@ -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; } diff --git a/src/common/spells/spells.c b/src/common/spells/spells.c index 9c9ca5477..d361677f1 100644 --- a/src/common/spells/spells.c +++ b/src/common/spells/spells.c @@ -5325,10 +5325,9 @@ 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); - return 0; + if (distance(mage->region, u->region) > power) { + ADDMSG(&mage->faction->msgs, msg_feedback(mage, co->order, "spellfail_distance", "")); + return 0; } u2 = createunit(u->region,mage->faction, RS_FARVISION, new_race[RC_SPELL]); @@ -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; } diff --git a/src/res/messages.xml b/src/res/messages.xml index 5973d3661..1dbea1848 100644 --- a/src/res/messages.xml +++ b/src/res/messages.xml @@ -5307,7 +5307,7 @@ "$unit($unit) in $region($region): '$order($command)' - $unit($unit) is not sufficiently stealthy." "$unit($unit) in $region($region): '$order($command)' - $unit($unit) is not sufficiently stealthy." - + @@ -6495,8 +6495,8 @@ - "$unit($unit) in $region($region): '$order($command)' - $unit($target) ist zu weit entfernt." - "$unit($unit) in $region($region): '$order($command)' - $unit($target) is too far away." + "$unit($unit) in $region($region): '$order($command)' - Die Region ist zu weit entfernt." + "$unit($unit) in $region($region): '$order($command)' - That region is too far away."