- Test 0 bei GIVERESTRICTION

This commit is contained in:
Christian Schlittchen 2002-01-13 12:36:25 +00:00
parent 673f2b4cb1
commit 1edddd76fa
2 changed files with 3 additions and 2 deletions

View File

@ -492,7 +492,7 @@ give_item(int want, const item_type * itype, unit * src, unit * dest, const char
n = new_get_pooled(src, item2resource(itype), GET_DEFAULT);
n = min(want, n);
#define GIVERESTRICTION 3
if (src->faction != dest->faction && src->faction->age < GIVERESTRICTION) {
if (dest && src->faction != dest->faction && src->faction->age < GIVERESTRICTION) {
ADDMSG(&src->faction->msgs, msg_error(src, cmd, "giverestriction",
"turns", GIVERESTRICTION));
return;
@ -537,7 +537,7 @@ givemen(int n, unit * u, unit * u2, const char * cmd)
int k = 0;
int error = 0;
if (u->faction != u2->faction && u->faction->age < GIVERESTRICTION) {
if (u2 && u->faction != u2->faction && u->faction->age < GIVERESTRICTION) {
ADDMSG(&u->faction->msgs, msg_error(u, cmd, "giverestriction",
"turns", GIVERESTRICTION));
return;

View File

@ -2124,6 +2124,7 @@ writegame(char *path, char quiet)
wnl(F);
write_items(F, u->items);
wnl(F);
assert(u->hp);
wi(F, u->hp);
wnl(F);
#if RELEASE_VERSION < MAGE_ATTRIB_VERSION