undead could still not give away items to peasants.

This commit is contained in:
Enno Rehling 2003-09-21 08:47:28 +00:00
parent cae86ae4d5
commit 6873e0d870
2 changed files with 448 additions and 443 deletions

View File

@ -911,7 +911,7 @@ dogive(region * r, unit * u, strlist * S, int mode)
/* Übergabe aller Kräuter */ /* Übergabe aller Kräuter */
if (findparam(s, u->faction->locale) == P_HERBS) { if (findparam(s, u->faction->locale) == P_HERBS) {
boolean given = false; boolean given = false;
if (!(u->race->ec_flags & GIVEITEM)) { if (!(u->race->ec_flags & GIVEITEM) && u2!=NULL) {
ADDMSG(&u->faction->msgs, ADDMSG(&u->faction->msgs,
msg_error(u, S->s, "race_nogive", "race", u->race)); msg_error(u, S->s, "race_nogive", "race", u->race));
return; return;
@ -972,7 +972,7 @@ dogive(region * r, unit * u, strlist * S, int mode)
} }
if (*s == 0) { if (*s == 0) {
if (!(u->race->ec_flags & GIVEITEM)) { if (!(u->race->ec_flags & GIVEITEM) && u2!=NULL) {
ADDMSG(&u->faction->msgs, ADDMSG(&u->faction->msgs,
msg_error(u, S->s, "race_nogive", "race", u->race)); msg_error(u, S->s, "race_nogive", "race", u->race));
return; return;
@ -1010,7 +1010,7 @@ dogive(region * r, unit * u, strlist * S, int mode)
return; return;
} }
if (!(u->race->ec_flags & GIVEITEM)) { if (!(u->race->ec_flags & GIVEITEM) && u2!=NULL) {
ADDMSG(&u->faction->msgs, ADDMSG(&u->faction->msgs,
msg_error(u, S->s, "race_nogive", "race", u->race)); msg_error(u, S->s, "race_nogive", "race", u->race));
return; return;
@ -1060,7 +1060,7 @@ dogive(region * r, unit * u, strlist * S, int mode)
} }
if (u2!=NULL) { if (u2!=NULL) {
if (!(u->race->ec_flags & GIVEITEM)) { if (!(u->race->ec_flags & GIVEITEM) && u2!=NULL) {
ADDMSG(&u->faction->msgs, ADDMSG(&u->faction->msgs,
msg_error(u, S->s, "race_nogive", "race", u->race)); msg_error(u, S->s, "race_nogive", "race", u->race));
return; return;

View File

@ -304,15 +304,20 @@ destroy_road(unit *u, int n, const char *cmd)
int road = rroad(r, d); int road = rroad(r, d);
region * r2 = rconnect(r,d); region * r2 = rconnect(r,d);
willdo = min(willdo, road); willdo = min(willdo, road);
if (willdo==0) {
/* TODO: error message */
}
#if 0 #if 0
salvage = willdo / divy; salvage = willdo / divy;
change_item(u, I_STONE, salvage); change_item(u, I_STONE, salvage);
#endif #endif
rsetroad(r, d, road - willdo); rsetroad(r, d, road - willdo);
if (road!=0 && road <= willdo) {
add_message(&u->faction->msgs, new_message( add_message(&u->faction->msgs, new_message(
u->faction, "destroy_road%u:unit%r:from%r:to", u, r, r2)); u->faction, "destroy_road%u:unit%r:from%r:to", u, r, r2));
} }
} }
}
void void
destroy(region * r, unit * u, const char * cmd) destroy(region * r, unit * u, const char * cmd)