forked from github/server
bug: durch unglückliche abfolge der abfragen wurde, wenn übergaben von
Gegenständen gesperrt waren, auch alles andere nicht erlaubt
This commit is contained in:
parent
08b74392c5
commit
6a8b681884
|
@ -900,11 +900,13 @@ dogive(region * r, unit * u, strlist * S, boolean liefere, int mode)
|
|||
msg_error(u, S->s, "race_nogive", "race", u->race));
|
||||
return;
|
||||
}
|
||||
/* sperrt hier auch personenübergaben!
|
||||
if (u2 && !(u2->race->ec_flags & GETITEM)) {
|
||||
add_message(&u->faction->msgs,
|
||||
msg_error(u, S->s, "race_notake", "race", u2->race));
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
/* Übergabe aller Kräuter */
|
||||
if (findparam(s, u->faction->locale) == P_HERBS) {
|
||||
|
@ -913,6 +915,11 @@ dogive(region * r, unit * u, strlist * S, boolean liefere, int mode)
|
|||
msg_error(u, S->s, "race_nogive", "race", u->race));
|
||||
return;
|
||||
}
|
||||
if (u2 && !(u2->race->ec_flags & GETITEM)) {
|
||||
ADDMSG(&u->faction->msgs,
|
||||
msg_error(u, S->s, "race_notake", "race", u2->race));
|
||||
return;
|
||||
}
|
||||
if (!u2) {
|
||||
if (!getunitpeasants) {
|
||||
cmistake(u, S->s, notfound_error, MSG_COMMERCE);
|
||||
|
@ -966,6 +973,12 @@ dogive(region * r, unit * u, strlist * S, boolean liefere, int mode)
|
|||
msg_error(u, S->s, "race_nogive", "race", u->race));
|
||||
return;
|
||||
}
|
||||
if (u2 && !(u2->race->ec_flags & GETITEM)) {
|
||||
ADDMSG(&u->faction->msgs,
|
||||
msg_error(u, S->s, "race_notake", "race", u2->race));
|
||||
return;
|
||||
}
|
||||
|
||||
/* für alle items einmal prüfen, ob wir mehr als von diesem Typ
|
||||
* reserviert ist besitzen und diesen Teil dann übergeben */
|
||||
if (u->items) {
|
||||
|
@ -998,6 +1011,12 @@ dogive(region * r, unit * u, strlist * S, boolean liefere, int mode)
|
|||
msg_error(u, S->s, "race_nogive", "race", u->race));
|
||||
return;
|
||||
}
|
||||
if (u2 && !(u2->race->ec_flags & GETITEM)) {
|
||||
ADDMSG(&u->faction->msgs,
|
||||
msg_error(u, S->s, "race_notake", "race", u2->race));
|
||||
return;
|
||||
}
|
||||
|
||||
itype = finditemtype(s, u->faction->locale);
|
||||
if (itype!=NULL) {
|
||||
item * i = *i_find(&u->items, itype);
|
||||
|
@ -1041,6 +1060,12 @@ dogive(region * r, unit * u, strlist * S, boolean liefere, int mode)
|
|||
msg_error(u, S->s, "race_nogive", "race", u->race));
|
||||
return;
|
||||
}
|
||||
if (u2 && !(u2->race->ec_flags & GETITEM)) {
|
||||
ADDMSG(&u->faction->msgs,
|
||||
msg_error(u, S->s, "race_notake", "race", u2->race));
|
||||
return;
|
||||
}
|
||||
|
||||
itype = finditemtype(s, u->faction->locale);
|
||||
if (itype!=NULL) {
|
||||
give_item(n, itype, u, u2, S->s);
|
||||
|
|
Loading…
Reference in New Issue