From 1a2b6ba98ba8ffd482ac94c4e7fa76910c446ffb Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sat, 9 Dec 2006 12:27:58 +0000 Subject: Allow alternating items with "nothing" to control generation chance. Example: ITEM: heal wounds / nothing Generation weight can be set with the weight: tag, which defaults to 10, so: ITEM: weight:1 heal wounds / nothing generates a potion of heal wounds 1 in 11 times it is used. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@601 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/dungeon.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crawl-ref/source/dungeon.cc') diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 49e0e6f90a..59fed1ab5f 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -5746,6 +5746,10 @@ static void dngn_place_item_explicit(int index, int x, int y, return; } + // Dummy object? + if (spec->base_type == OBJ_UNASSIGNED) + return; + if (spec->level >= 0) level = spec->level; -- cgit v1.2.3-54-g00ecf