revisit #H4083 - glob ID and merging

Globs on the floor used different criteria (anything goes) than globs
in inventory (mostly requiring same ownership when in shops and same
curse/bless state--other stuff generally isn't applicable) when
deciding whether two globs should merge.  That was okay as long as
the globs on the floor were from being left behind when a pudding or
ooze was killed, but not if the player had picked some up, dipped
them in holy or unholy water, and dropped them again.  This changes
things so that globs on the floor use the same criteria as globs in
inventory when deciding whether to coallesce.

Also, my earlier fix was modifying globs in the mergeable() test (to
make bknown and rknown match) rather than during actual merge, which
would be a problem if the merger didn't take place for some reason.
This commit is contained in:
PatR
2016-01-28 18:13:25 -08:00
parent a309e076e0
commit b632247a74
4 changed files with 46 additions and 49 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 do.c $NHDT-Date: 1446975464 2015/11/08 09:37:44 $ $NHDT-Branch: master $:$NHDT-Revision: 1.149 $ */
/* NetHack 3.6 do.c $NHDT-Date: 1454033599 2016/01/29 02:13:19 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.153 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -215,15 +215,13 @@ const char *verb;
otense(obj, "tumble"), the_your[t->madeby_u]);
} else if (obj->globby) {
/* Globby things like puddings might stick together */
while (obj
&& (otmp = obj_nexto_xy(obj->otyp, x, y, obj->o_id))
!= (struct obj *) 0) {
while (obj && (otmp = obj_nexto_xy(obj, x, y, TRUE)) != 0) {
pudding_merge_message(obj, otmp);
/* intentionally not getting the melded object; obj_meld may set
* obj to null. */
(void) obj_meld(&obj, &otmp);
}
return (boolean) (obj == NULL);
return (boolean) !obj;
}
return FALSE;
}