avoid another magic number

Some of the hardcoded +1 scattered about are likely
invlet_gold or invlet_overflow, but I didn't hunt those down.
This commit is contained in:
nhmall
2023-11-30 11:15:32 -05:00
parent 9847fcb5b1
commit d7fef5f194
12 changed files with 44 additions and 26 deletions

View File

@@ -3887,7 +3887,7 @@ wizkit_addinv(struct obj *obj)
if (Role_if(PM_CLERIC))
obj->bknown = 1; /* ok to bypass set_bknown() */
/* same criteria as lift_object()'s check for available inventory slot */
if (obj->oclass != COIN_CLASS && inv_cnt(FALSE) >= 52
if (obj->oclass != COIN_CLASS && inv_cnt(FALSE) >= invlet_basic
&& !merge_choice(gi.invent, obj)) {
/* inventory overflow; can't just place & stack object since
hero isn't in position yet, so schedule for arrival later */