alternate fix for merge_choice() with Null invent
merge_choice() doesn't need the address of its list argument, just to
return Null if that list is Null. Could have been solved by having
its callers check for Null invent and skip the call if necessary but
this is simpler.
Finishes reverting commit 378648bd9c.
This commit is contained in:
@@ -1239,7 +1239,7 @@ extern Loot *sortloot(struct obj **, unsigned, boolean,
|
||||
boolean(*)(struct obj *)) NONNULLARG1;
|
||||
extern void unsortloot(Loot **) NONNULLARG1;
|
||||
extern void assigninvlet(struct obj *) NONNULLARG1;
|
||||
extern struct obj *merge_choice(struct obj *, struct obj *) NONNULLPTRS;
|
||||
extern struct obj *merge_choice(struct obj *, struct obj *) NONNULLARG2;
|
||||
extern int merged(struct obj **, struct obj **) NONNULLPTRS;
|
||||
extern void addinv_core1(struct obj *) NONNULLARG1;
|
||||
extern void addinv_core2(struct obj *) NONNULLARG1;
|
||||
|
||||
@@ -786,6 +786,8 @@ merge_choice(struct obj *objlist, struct obj *obj)
|
||||
struct monst *shkp;
|
||||
unsigned save_nocharge;
|
||||
|
||||
if (!objlist) /* might be checking 'obj' against empty inventory */
|
||||
return (struct obj *) 0;
|
||||
if (obj->otyp == SCR_SCARE_MONSTER) /* punt on these */
|
||||
return (struct obj *) 0;
|
||||
/* if this is an item on the shop floor, the attributes it will
|
||||
|
||||
Reference in New Issue
Block a user