From: Pasi Kallinen Date: Tue, 24 Mar 2015 17:46:38 +0000 (+0200) Subject: Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource into paxed... X-Git-Tag: NetHack-3.6.0_RC01~492^2~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0a9248c7f14f9df95b0514849cb5f594631cfce9;p=nethack Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource into paxed-new_lev_comp Conflicts: doc/fixes35.0 include/extern.h include/ntconf.h include/obj.h include/patchlevel.h src/dig.c src/do.c src/files.c src/fountain.c src/mklev.c src/objnam.c src/options.c src/potion.c src/rumors.c src/save.c src/topten.c src/trap.c src/wield.c sys/share/pcmain.c sys/unix/unixmain.c sys/winnt/Makefile.msc util/lev_main.c util/makedefs.c --- 0a9248c7f14f9df95b0514849cb5f594631cfce9 diff --cc src/sp_lev.c index 46334a4ab,c495d5c99..8278a344b --- a/src/sp_lev.c +++ b/src/sp_lev.c @@@ -1614,45 -1042,80 +1614,57 @@@ struct mkroom *croom * resistant (if they were, we'd have to reset the name as well as * setting corpsenm). */ - for (wastyp = otmp->corpsenm; ; wastyp = rndmonnum()) { + for (wastyp = otmp->corpsenm; i < 1000 ; i++, wastyp = rndmonnum()) { /* makemon without rndmonst() might create a group */ was = makemon(&mons[wastyp], 0, 0, MM_NOCOUNTBIRTH); - if (!resists_ston(was)) { + if (was) { + if (!resists_ston(was)) { (void) propagate(wastyp, TRUE, FALSE); break; + } + mongone(was); + was = NULL; } - mongone(was); } - set_corpsenm(otmp, wastyp); - while(was->minvent) { - obj = was->minvent; - obj->owornmask = 0; - obj_extract_self(obj); - (void) add_to_container(otmp, obj); + if (was) { + set_corpsenm(otmp, wastyp); + while(was->minvent) { + obj = was->minvent; + obj->owornmask = 0; + obj_extract_self(obj); + (void) add_to_container(otmp, obj); + } + otmp->owt = weight(otmp); + mongone(was); } - otmp->owt = weight(otmp); - mongone(was); } + /* Nasty hack here: try to determine if this is the Mines or Sokoban + * "prize" and then set record_achieve_special (maps to corpsenm) + * for the object. That field will later be checked to find out if + * the player obtained the prize. */ + if(otmp->otyp == LUCKSTONE && Is_mineend_level(&u.uz)) { + otmp->record_achieve_special = 1; + } else if((otmp->otyp == AMULET_OF_REFLECTION || + otmp->otyp == BAG_OF_HOLDING) && + Is_sokoend_level(&u.uz)) { + otmp->record_achieve_special = 1; + } + stackobj(otmp); - } /* if (rn2(100) < o->chance) */ - o_done: - Free(o->name.str); -} - -/* - * Randomly place a specific engraving, then release its memory. - */ -STATIC_OVL void -create_engraving(e, croom) -engraving *e; -struct mkroom *croom; -{ - xchar x, y; - - x = e->x, y = e->y; - if (croom) - get_room_loc(&x, &y, croom); - else - get_location(&x, &y, DRY); - - make_engr_at(x, y, e->engr.str, 0L, e->etype); - free((genericptr_t) e->engr.str); -} - -/* - * Create stairs in a room. - * - */ + if (o->lit) { + begin_burn(otmp, FALSE); + } -STATIC_OVL void -create_stairs(s,croom) -stair *s; -struct mkroom *croom; -{ - schar x,y; + if (o->buried) { + boolean dealloced; + (void) bury_an_obj(otmp, &dealloced); + if (dealloced && container_idx) { + container_obj[container_idx-1] = NULL; + } + } - x = s->x; y = s->y; - get_free_room_loc(&x, &y, croom); - mkstairs(x,y,(char)s->up, croom); } /* diff --cc src/trap.c index 8fa07cbe4,a0c6fa1b1..60022b955 --- a/src/trap.c +++ b/src/trap.c @@@ -3157,7 -3165,7 +3165,8 @@@ struct obj *obj const char *ostr; boolean force; { + boolean exploded = FALSE; + if (!obj) return ER_NOTHING; if (snuff_lit(obj)) return ER_DAMAGED;