diff -c -r sl-orig/dat/opthelp sl-cm/dat/opthelp *** sl-orig/dat/opthelp Fri Aug 31 14:25:24 2001 --- sl-cm/dat/opthelp Fri Nov 2 14:11:12 2001 *************** *** 54,59 **** --- 54,62 ---- Boolean option if MFLOPPY was set at compile time: checkspace check free disk space before writing files to disk [TRUE] + Boolean option if CONTAINER_MERGE was set at compilet time: + cont_merge merge objects that are put inside containers [TRUE] + Boolean option if EXP_ON_BOTL was set at compile time: showexp display your accumulated experience points [FALSE] diff -c -r sl-orig/doc/guideb~1.mn sl-cm/doc/guideb~1.mn *** sl-orig/doc/guideb~1.mn Fri Aug 31 14:25:26 2001 --- sl-cm/doc/guideb~1.mn Fri Nov 2 14:13:34 2001 *************** *** 1687,1692 **** --- 1687,1695 ---- .lp "confirm " Have user confirm attacks on pets, shopkeepers, and other peaceable creatures (default on). + .lp cont_merge + If true, merges objects placed inside containers with the existing + contents of the container. .lp DECgraphics Use a predefined selection of characters from the DEC VT-xxx/DEC Rainbow/ANSI line-drawing character set to display the dungeon/effects/traps diff -c -r sl-orig/doc/guideb~1.tex sl-cm/doc/guideb~1.tex *** sl-orig/doc/guideb~1.tex Fri Aug 31 14:26:18 2001 --- sl-cm/doc/guideb~1.tex Fri Nov 2 14:15:08 2001 *************** *** 2344,2349 **** --- 2344,2354 ---- peaceable creatures (default on). %.lp + \item[\ib{cont\_merge}] + If true, merges objects placed inside containers with the existing + contents of the container. + %.lp + \item[\ib{DECgraphics}] Use a predefined selection of characters from the DEC VT-xxx/DEC Rainbow/ANSI line-drawing character set to display the dungeon/effects/traps diff -c -r sl-orig/doc/guideb~1.txt sl-cm/doc/guideb~1.txt *** sl-orig/doc/guideb~1.txt Fri Aug 31 14:26:16 2001 --- sl-cm/doc/guideb~1.txt Fri Nov 2 14:16:12 2001 *************** *** 2197,2202 **** --- 2197,2206 ---- Have user confirm attacks on pets, shopkeepers, and other peaceable creatures (default on). + cont_merge + Merges objects placed in containers with the existing + contents of the container (default on). + DECgraphics Use a predefined selection of characters from the DEC VT- xxx/DEC Rainbow/ANSI line-drawing character set to display diff -c -r sl-orig/include/config.h sl-cm/include/config.h *** sl-orig/include/config.h Fri Aug 31 14:26:06 2001 --- sl-cm/include/config.h Fri Nov 2 14:19:58 2001 *************** *** 404,409 **** --- 404,411 ---- /* Originally added by zaga. */ #define OTHER_SERVICES /* shopkeeper services */ + #define CONT_MERGE /* container merge */ + /* #define SHOUT */ /* JRN -- shouting and petcommands - not implemented */ /* #define DEVEL_BRANCH */ /* Include development code */ diff -c -r sl-orig/include/flag.h sl-cm/include/flag.h *** sl-orig/include/flag.h Fri Aug 31 14:25:28 2001 --- sl-cm/include/flag.h Sat Jan 5 15:54:00 2002 *************** *** 164,169 **** --- 164,172 ---- struct instance_flags { boolean cbreak; /* in cbreak mode, rogue format */ + #ifdef CONT_MERGE + boolean cont_merge; /* merge objects in containers */ + #endif boolean DECgraphics; /* use DEC VT-xxx extended character set */ boolean echo; /* 1 to echo characters */ #ifdef TTY_GRAPHICS diff -c -r sl-orig/src/mkobj.c sl-cm/src/mkobj.c *** sl-orig/src/mkobj.c Fri Aug 31 14:25:36 2001 --- sl-cm/src/mkobj.c Sat Jan 5 15:54:40 2002 *************** *** 1507,1515 **** --- 1507,1527 ---- add_to_container(container, obj) struct obj *container, *obj; { + struct obj *otmp; + if (obj->where != OBJ_FREE) panic("add_to_container: obj not free"); + /* Merge if possible */ + if ( + #ifdef CONT_MERGE + iflags.cont_merge || + #endif + obj->oclass == GOLD_CLASS) { + for (otmp = container->cobj; otmp; otmp = otmp->nobj) + if (merged(&otmp, &obj)) return; + } + obj->where = OBJ_CONTAINED; obj->ocontainer = container; obj->nobj = container->cobj; diff -c -r sl-orig/src/options.c sl-cm/src/options.c *** sl-orig/src/options.c Fri Aug 31 14:25:30 2001 --- sl-cm/src/options.c Sat Jan 5 15:54:28 2002 *************** *** 68,73 **** --- 68,76 ---- {"color", (boolean *)0, FALSE}, #endif {"confirm",&flags.confirm, TRUE}, + #ifdef CONT_MERGE + {"cont_merge", &iflags.cont_merge, TRUE}, + #endif #ifdef TERMLIB {"DECgraphics", &iflags.DECgraphics, FALSE}, #else diff -c -r sl-orig/src/pickup.c sl-cm/src/pickup.c *** sl-orig/src/pickup.c Fri Aug 31 14:25:38 2001 --- sl-cm/src/pickup.c Fri Nov 2 19:14:10 2001 *************** *** 1478,1484 **** in_container(obj) register struct obj *obj; { ! register struct obj *gold; boolean is_gold = (obj->oclass == GOLD_CLASS); boolean floor_container = !carried(current_container); char buf[BUFSZ]; --- 1478,1484 ---- in_container(obj) register struct obj *obj; { ! /* register struct obj *gold; */ /* Contmerge */ boolean is_gold = (obj->oclass == GOLD_CLASS); boolean floor_container = !carried(current_container); char buf[BUFSZ]; *************** *** 1545,1572 **** freeinv(obj); - if (is_gold) { /* look for other money to merge within the container */ - for (gold = current_container->cobj; gold; gold = gold->nobj) - if (gold->otyp == obj->otyp) break; - } else - gold = 0; - - if (gold) { - gold->quan += obj->quan; - gold->owt = weight(gold); - } else { - add_to_container(current_container, obj); - } - - current_container->owt = weight(current_container); - #ifdef SHOW_WEIGHT - if (!floor_container && flags.invweight) - update_inventory(); - #endif - - Strcpy(buf, the(xname(current_container))); - You("put %s into %s.", doname(obj), buf); - if (obj_is_burning(obj)) /* this used to be part of freeinv() */ (void) snuff_lit(obj); --- 1545,1550 ---- *************** *** 1596,1601 **** --- 1574,1582 ---- (void)stolen_value(current_container, u.ux, u.uy, (boolean)shkp->mpeaceful, FALSE); } + obfree(obj, (struct obj *)0); + /* obfree because we haven't actually put it in the bag yet */ + delete_contents(current_container); if (!floor_container) useup(current_container); *************** *** 1608,1617 **** current_container = 0; /* baggone = TRUE; */ } ! if (is_gold) { ! if (gold) dealloc_obj(obj); ! bot(); /* update character's gold piece count immediately */ ! } return(current_container ? 1 : -1); } --- 1589,1607 ---- current_container = 0; /* baggone = TRUE; */ } ! if (current_container) { ! Strcpy(buf, the(xname(current_container))); ! You("put %s into %s.", doname(obj), buf); ! ! add_to_container(current_container, obj); ! current_container->owt = weight(current_container); ! } ! if (is_gold) bot(); /* update character's gold piece count immediately */ ! ! #ifdef SHOW_WEIGHT ! if (!floor_container && flags.invweight) ! update_inventory(); ! #endif return(current_container ? 1 : -1); }