"Übergaben haben teilweise geklappt trotz fehlendem helfestatus"
This commit is contained in:
Enno Rehling 2008-05-04 06:44:07 +00:00
parent d7be4a21c2
commit 111051a580
5 changed files with 20 additions and 27 deletions

View file

@ -603,6 +603,7 @@ give_cmd(unit * u, order * ord)
s = getstrtoken(); s = getstrtoken();
p = findparam(s, u->faction->locale); p = findparam(s, u->faction->locale);
/* first, do all the ones that do not require HELP_GIVE or CONTACT */
if (p == P_CONTROL) { if (p == P_CONTROL) {
message * msg; message * msg;
@ -633,7 +634,7 @@ give_cmd(unit * u, order * ord)
freset(u, UFL_OWNER); freset(u, UFL_OWNER);
fset(u2, UFL_OWNER); fset(u2, UFL_OWNER);
msg = msg_message("givecommand", "unit receipient", u, u2); msg = msg_message("givecommand", "unit recipient", u, u2);
add_message(&u->faction->msgs, msg); add_message(&u->faction->msgs, msg);
if (u->faction != u2->faction) { if (u->faction != u2->faction) {
add_message(&u2->faction->msgs, msg); add_message(&u2->faction->msgs, msg);
@ -647,21 +648,17 @@ give_cmd(unit * u, order * ord)
return; return;
} }
/* if ((u->race->ec_flags & NOGIVE) || fval(u,UFL_LOCKED)) {*/ else if (u2 && !alliedunit(u2, u->faction, HELP_GIVE) && !ucontact(u2, u)) {
else if (u->race->ec_flags & NOGIVE && u2!=NULL) { cmistake(u, ord, 40, MSG_COMMERCE);
return;
}
else if (u2 && u->race->ec_flags & NOGIVE) {
ADDMSG(&u->faction->msgs, ADDMSG(&u->faction->msgs,
msg_feedback(u, ord, "race_nogive", "race", u->race)); msg_feedback(u, ord, "race_nogive", "race", u->race));
return; return;
} }
/* sperrt hier auch personenübergaben!
else if (u2 && !(u2->race->ec_flags & GETITEM)) {
ADDMSG(&u->faction->msgs,
msg_feedback(u, ord, "race_notake", "race", u2->race));
return;
}
*/
/* Übergabe aller Kräuter */
else if (p == P_HERBS) { else if (p == P_HERBS) {
boolean given = false; boolean given = false;
if (!(u->race->ec_flags & GIVEITEM) && u2!=NULL) { if (!(u->race->ec_flags & GIVEITEM) && u2!=NULL) {
@ -713,10 +710,6 @@ give_cmd(unit * u, order * ord)
return; return;
} }
if (u2 && !alliedunit(u2, u->faction, HELP_GIVE) && !ucontact(u2, u)) {
cmistake(u, ord, 40, MSG_COMMERCE);
return;
}
give_unit(u, u2, ord); give_unit(u, u2, ord);
return; return;
} }
@ -726,11 +719,6 @@ give_cmd(unit * u, order * ord)
if (*s == 0) { /* Alle Gegenstände übergeben */ if (*s == 0) { /* Alle Gegenstände übergeben */
if (u2 && !alliedunit(u2, u->faction, HELP_GIVE) && !ucontact(u2, u)) {
cmistake(u, ord, 40, MSG_COMMERCE);
return;
}
/* do these checks once, not for each item we have: */ /* do these checks once, not for each item we have: */
if (!(u->race->ec_flags & GIVEITEM) && u2!=NULL) { if (!(u->race->ec_flags & GIVEITEM) && u2!=NULL) {
ADDMSG(&u->faction->msgs, ADDMSG(&u->faction->msgs,
@ -805,7 +793,7 @@ give_cmd(unit * u, order * ord)
s = getstrtoken(); /* skip one ahead to get the amount. */ s = getstrtoken(); /* skip one ahead to get the amount. */
} }
n = atoip((const char *)s); /* n: anzahl */ n = atoip((const char *)s); /* n: Anzahl */
if (p==P_EACH) { if (p==P_EACH) {
n *= u2->number; n *= u2->number;
} }

View file

@ -183,7 +183,7 @@ report_summary(summary * s, summary * o, boolean full)
const race * rc = new_race[i]; const race * rc = new_race[i];
if (s->factionrace[i] && rc && playerrace(rc) if (s->factionrace[i] && rc && playerrace(rc)
&& i != RC_TEMPLATE && i != RC_CLONE) { && i != RC_TEMPLATE && i != RC_CLONE) {
fprintf(F, "%13svoelker: %s\n", LOC(default_locale, rc_name(rc, 3)), fprintf(F, "%13s%s: %s\n", LOC(default_locale, rc_name(rc, 3)), LOC(default_locale, "stat_tribe_p"),
pcomp(s->factionrace[i], o->factionrace[i])); pcomp(s->factionrace[i], o->factionrace[i]));
} }
} }

View file

@ -29,7 +29,7 @@
int int
atoi36(const char * str) atoi36(const char * str)
{ {
/* cannot use strtol, becuase invalid strings will cause crash */ /* cannot use strtol, because invalid strings will cause crash */
const unsigned char * s = (const unsigned char *)str; const unsigned char * s = (const unsigned char *)str;
int i = 0, sign = 1; int i = 0, sign = 1;
assert(s); assert(s);

View file

@ -7561,6 +7561,11 @@
<text locale="en">shipid</text> <text locale="en">shipid</text>
</string> </string>
<string name="stat_tribe_p">
<text locale="de">völker</text>
<text locale="en"> tribes</text>
</string>
<string name="par_building"> <string name="par_building">
<text locale="de">Gebäude-Nr</text> <text locale="de">Gebäude-Nr</text>
<text locale="en">buildingid</text> <text locale="en">buildingid</text>

View file

@ -3669,11 +3669,11 @@
<message name="givecommand" section="events"> <message name="givecommand" section="events">
<type> <type>
<arg name="unit" type="unit"/> <arg name="unit" type="unit"/>
<arg name="receipient" type="unit"/> <arg name="recipient" type="unit"/>
</type> </type>
<text locale="de">"$unit($unit) gibt das Kommando an $unit($receipient)."</text> <text locale="de">"$unit($unit) gibt das Kommando an $unit($recipient)."</text>
<text locale="fr">"$unit($unit) gave control to $unit($receipient)."</text> <text locale="fr">"$unit($unit) gave control to $unit($recipient)."</text>
<text locale="en">"$unit($unit) gave control to $unit($receipient)."</text> <text locale="en">"$unit($unit) gave control to $unit($recipient)."</text>
</message> </message>
<message name="givedumb" section="events"> <message name="givedumb" section="events">
<type> <type>