unsplitting split object stack
Replace the code that Dean objected to with something a little bit more robust. It doesn't rely on the two stacks being adjacent or having the same inventory letter. It is still vulnerable to having another splitobj() occur between the offending split and its attempted unsplit, or to either of the two halves of a split being extracted from their object chain. As before, failure to unsplit only results in the two halves of the split remaining separate stacks, not anything more drastic like the panic() that prompted all this. Simplification of hallucinated currency names got mixed in with this patch. I haven't bothered separating it back out. Whoever reset PATCHLEVEL to 0 jumped the gun. This patch increments it since change to the 'context' structure breaks save file compatibility, so it will need to undergo another reset before release.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 extern.h $NHDT-Date: 1445126411 2015/10/18 00:00:11 $ $NHDT-Branch: master $:$NHDT-Revision: 1.508 $ */
|
||||
/* NetHack 3.6 extern.h $NHDT-Date: 1445215014 2015/10/19 00:36:54 $ $NHDT-Branch: master $:$NHDT-Revision: 1.509 $ */
|
||||
/* Copyright (c) Steve Creps, 1988. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -1214,6 +1214,8 @@ E struct obj *FDECL(mkobj, (CHAR_P, BOOLEAN_P));
|
||||
E int NDECL(rndmonnum);
|
||||
E boolean FDECL(bogon_is_pname, (CHAR_P));
|
||||
E struct obj *FDECL(splitobj, (struct obj *, long));
|
||||
E struct obj *FDECL(unsplitobj, (struct obj *));
|
||||
E void NDECL(clear_splitobjs);
|
||||
E void FDECL(replace_object, (struct obj *, struct obj *));
|
||||
E void FDECL(bill_dummy_object, (struct obj *));
|
||||
E void FDECL(costly_alteration, (struct obj *, int));
|
||||
|
||||
Reference in New Issue
Block a user