forked from github/server
fix bug in last change, could not give items to peasants.
This commit is contained in:
parent
5df3c3dc4b
commit
010dde1cb8
28
src/give.c
28
src/give.c
|
@ -1004,25 +1004,23 @@ param_t give_cmd(unit * u, order * ord)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (u2 != NULL) {
|
||||
if (!(u_race(u2)->ec_flags & ECF_GETITEM)) {
|
||||
ADDMSG(&u->faction->msgs,
|
||||
msg_feedback(u, ord, "race_notake", "race", u_race(u2)));
|
||||
}
|
||||
else {
|
||||
itype = finditemtype(s, u->faction->locale);
|
||||
if (itype != NULL) {
|
||||
if (can_give(u, u2, itype, 0)) {
|
||||
give_item(n, itype, u, u2, ord);
|
||||
}
|
||||
else {
|
||||
feedback_give_not_allowed(u, ord);
|
||||
}
|
||||
else if (u2 != NULL && !(u_race(u2)->ec_flags & ECF_GETITEM)) {
|
||||
ADDMSG(&u->faction->msgs,
|
||||
msg_feedback(u, ord, "race_notake", "race", u_race(u2)));
|
||||
}
|
||||
else {
|
||||
itype = finditemtype(s, u->faction->locale);
|
||||
if (itype != NULL) {
|
||||
if (can_give(u, u2, itype, 0)) {
|
||||
give_item(n, itype, u, u2, ord);
|
||||
}
|
||||
else {
|
||||
cmistake(u, ord, 123, MSG_COMMERCE);
|
||||
feedback_give_not_allowed(u, ord);
|
||||
}
|
||||
}
|
||||
else {
|
||||
cmistake(u, ord, 123, MSG_COMMERCE);
|
||||
}
|
||||
}
|
||||
}
|
||||
return p;
|
||||
|
|
Loading…
Reference in New Issue