summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreaverb <reaverb.Crawl@gmail.com>2014-08-08 03:57:55 -0400
committerreaverb <reaverb.Crawl@gmail.com>2014-08-08 15:00:27 -0400
commit959592d6485a5aec6e0fb404f31edce8dd690e11 (patch)
treea4c97b5ea792cc5720bbb75661653af2f2efd08c
parent8ce947975fa9f9c0b3d8575ab43ff042c5d6b872 (diff)
downloadcrawl-ref-959592d6485a5aec6e0fb404f31edce8dd690e11.tar.gz
crawl-ref-959592d6485a5aec6e0fb404f31edce8dd690e11.zip
Remove 2 more parameters from items()
They were only used in one place, and the relevant code was moved to that one place in the previous commit.
-rw-r--r--crawl-ref/source/abyss.cc6
-rw-r--r--crawl-ref/source/acquire.cc8
-rw-r--r--crawl-ref/source/butcher.cc2
-rw-r--r--crawl-ref/source/dgn-labyrinth.cc2
-rw-r--r--crawl-ref/source/dungeon.cc10
-rw-r--r--crawl-ref/source/godprayer.cc6
-rw-r--r--crawl-ref/source/makeitem.cc15
-rw-r--r--crawl-ref/source/makeitem.h3
-rw-r--r--crawl-ref/source/mon-gear.cc26
-rw-r--r--crawl-ref/source/monster.cc2
-rw-r--r--crawl-ref/source/religion.cc4
-rw-r--r--crawl-ref/source/wiz-item.cc2
-rw-r--r--crawl-ref/source/wiz-mon.cc2
-rw-r--r--crawl-ref/source/xom.cc6
-rw-r--r--crawl-ref/source/zotdef.cc2
15 files changed, 44 insertions, 52 deletions
diff --git a/crawl-ref/source/abyss.cc b/crawl-ref/source/abyss.cc
index 2d96fc22e0..f8763f32b1 100644
--- a/crawl-ref/source/abyss.cc
+++ b/crawl-ref/source/abyss.cc
@@ -292,7 +292,7 @@ static bool _abyss_place_rune(const map_bitmask &abyss_genlevel_mask,
if (places_found)
{
dprf("Placing abyssal rune at (%d,%d)", chosen_spot.x, chosen_spot.y);
- int item_ind = items(1, OBJ_MISCELLANY, MISC_RUNE_OF_ZOT, true, 0);
+ int item_ind = items(true, OBJ_MISCELLANY, MISC_RUNE_OF_ZOT, 0);
if (item_ind != NON_ITEM)
{
mitm[item_ind].plus = RUNE_ABYSSAL;
@@ -371,8 +371,8 @@ static int _abyss_create_items(const map_bitmask &abyss_genlevel_mask,
const coord_def place(chosen_item_places[i]);
if (_abyss_square_accepts_items(abyss_genlevel_mask, place))
{
- int thing_created = items(1, OBJ_RANDOM, OBJ_RANDOM,
- true, items_level, 250);
+ int thing_created = items(true, OBJ_RANDOM, OBJ_RANDOM,
+ items_level);
move_item_to_grid(&thing_created, place);
if (thing_created != NON_ITEM)
{
diff --git a/crawl-ref/source/acquire.cc b/crawl-ref/source/acquire.cc
index 49ab48658c..68ffd661e6 100644
--- a/crawl-ref/source/acquire.cc
+++ b/crawl-ref/source/acquire.cc
@@ -1155,8 +1155,8 @@ int acquirement_create_item(object_class_type class_wanted,
if (agent == GOD_TROG && !one_chance_in(3))
want_arts = false;
- thing_created = items(want_arts, class_wanted, type_wanted, true,
- ITEM_LEVEL, 0, 0, agent);
+ thing_created = items(want_arts, class_wanted, type_wanted,
+ ITEM_LEVEL, 0, agent);
if (thing_created == NON_ITEM)
continue;
@@ -1219,8 +1219,8 @@ int acquirement_create_item(object_class_type class_wanted,
if (at != NUM_ARMOURS)
{
destroy_item(thing_created, true);
- thing_created = items(true, OBJ_ARMOUR, at, true,
- ITEM_LEVEL, 0, 0, agent);
+ thing_created = items(true, OBJ_ARMOUR, at,
+ ITEM_LEVEL, 0, agent);
}
else if (agent != GOD_XOM && one_chance_in(3))
{
diff --git a/crawl-ref/source/butcher.cc b/crawl-ref/source/butcher.cc
index fa55bf47db..8e0d548e60 100644
--- a/crawl-ref/source/butcher.cc
+++ b/crawl-ref/source/butcher.cc
@@ -48,7 +48,7 @@ static void _create_monster_hide(const item_def corpse)
die("an unknown hide drop");
}
- int o = items(0, OBJ_ARMOUR, type, true, 0);
+ int o = items(false, OBJ_ARMOUR, type, 0);
squash_plusses(o);
if (o == NON_ITEM)
diff --git a/crawl-ref/source/dgn-labyrinth.cc b/crawl-ref/source/dgn-labyrinth.cc
index e57ad3cee5..56c91b6879 100644
--- a/crawl-ref/source/dgn-labyrinth.cc
+++ b/crawl-ref/source/dgn-labyrinth.cc
@@ -110,7 +110,7 @@ static void _labyrinth_place_items(const coord_def &end)
0);
const int treasure_item =
- items(1, glopop, OBJ_RANDOM, true,
+ items(true, glopop, OBJ_RANDOM,
one_chance_in(3) ? env.absdepth0 * 3 : MAKE_GOOD_ITEM);
if (treasure_item != NON_ITEM)
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index 2429324f4e..7284f8e1cb 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -4021,7 +4021,7 @@ static void _builder_items()
for (i = 0; i < items_wanted; i++)
{
- int item = items(1, specif_type, OBJ_RANDOM, true, items_levels);
+ int item = items(true, specif_type, OBJ_RANDOM, items_levels);
_randomly_place_item(item);
}
@@ -4692,7 +4692,7 @@ int dgn_place_item(const item_spec &spec,
item_made = _dgn_item_corpse(spec, where);
else
item_made = items(spec.allow_uniques, base_type,
- spec.sub_type, true, level, 0, spec.ego);
+ spec.sub_type, level, spec.ego);
if (spec.level == ISPEC_MUNDANE)
squash_plusses(item_made);
@@ -4819,7 +4819,7 @@ static void _dgn_give_mon_spec_items(mons_spec &mspec,
else
{
item_made = items(spec.allow_uniques, spec.base_type,
- spec.sub_type, true, item_level, 0,
+ spec.sub_type, item_level,
spec.ego);
if (spec.level == ISPEC_MUNDANE)
@@ -5243,7 +5243,7 @@ static void _vault_grid_glyph(vault_placement &place, const coord_def& where,
else if (vgrid == '*')
which_depth = 5 + which_depth * 2;
- item_made = items(1, which_class, which_type, true, which_depth);
+ item_made = items(true, which_class, which_type, which_depth);
if (item_made != NON_ITEM)
mitm[item_made].pos = where;
}
@@ -5753,7 +5753,7 @@ void place_spec_shop(const coord_def& where,
orb = dgn_place_item(spec->items.get_item(j), stock_loc, item_level);
else
{
- orb = items(1, basetype, subtype, true,
+ orb = items(true, basetype, subtype,
one_chance_in(4) ? MAKE_GOOD_ITEM : item_level);
}
diff --git a/crawl-ref/source/godprayer.cc b/crawl-ref/source/godprayer.cc
index 23cb0fac3f..d86b9bfae6 100644
--- a/crawl-ref/source/godprayer.cc
+++ b/crawl-ref/source/godprayer.cc
@@ -258,8 +258,8 @@ static bool _altar_prayer()
}
}
- int thing_created = items(1, OBJ_BOOKS, BOOK_NECRONOMICON, true, 1, 0,
- 0, you.religion);
+ int thing_created = items(true, OBJ_BOOKS, BOOK_NECRONOMICON, 1, 0,
+ you.religion);
if (thing_created == NON_ITEM || !move_item_to_grid(&thing_created, you.pos()))
return false;
@@ -588,7 +588,7 @@ static void _ashenzari_sac_scroll(const item_def& item)
jwl, SCR_CURSE_JEWELLERY,
0);
}
- int it = items(0, OBJ_SCROLLS, scr, true, 0, 0, 0, GOD_ASHENZARI);
+ int it = items(false, OBJ_SCROLLS, scr, 0, 0, GOD_ASHENZARI);
if (it == NON_ITEM)
{
mpr("You feel the world is against you.");
diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc
index 9a3c06c5ee..19ae34600b 100644
--- a/crawl-ref/source/makeitem.cc
+++ b/crawl-ref/source/makeitem.cc
@@ -2651,9 +2651,7 @@ void squash_plusses(int item_slot)
* @param allow_uniques Can the item generated be an artefact?
* @param force_class The desired OBJECTS class (Example: OBJ_ARMOUR)
* @param force_type The desired SUBTYPE - enum varies by OBJ
- * @param dont_place If this is false, the item is randomly placed on the level
* @param item_level How powerful the item is allowed to be
- * @param uint32_t mapmask TODO: remove
* @param force_ego The desired ego/brand
* @param agent The agent creating the item (Example: Xom) or -1 if NA
*
@@ -2662,9 +2660,7 @@ void squash_plusses(int item_slot)
int items(bool allow_uniques,
object_class_type force_class,
int force_type,
- bool dont_place,
int item_level,
- uint32_t mapmask,
int force_ego,
int agent)
{
@@ -2847,13 +2843,10 @@ int items(bool allow_uniques,
// Set brand appearance.
item_set_appearance(item);
- if (dont_place)
- {
- item.pos.reset();
- item.link = NON_ITEM;
- }
- else
- die("dont_place is used outside dungeon.cc oops");
+ // Don't place the item just yet.
+ item.pos.reset();
+ item.link = NON_ITEM;
+
// Note that item might be invalidated now, since p could have changed.
ASSERT(mitm[p].is_valid());
return p;
diff --git a/crawl-ref/source/makeitem.h b/crawl-ref/source/makeitem.h
index eb1fc275cf..611b685b88 100644
--- a/crawl-ref/source/makeitem.h
+++ b/crawl-ref/source/makeitem.h
@@ -11,8 +11,7 @@
int create_item_named(string name, coord_def pos, string *error);
int items(bool allow_uniques, object_class_type force_class, int force_type,
- bool dont_place, int item_level, uint32_t mapmask = 0,
- int force_ego = 0, int agent = -1);
+ int item_level, int force_ego = 0, int agent = -1);
void item_colour(item_def &item);
void init_rod_mp(item_def &item, int ncharges = -1, int item_level = -1);
diff --git a/crawl-ref/source/mon-gear.cc b/crawl-ref/source/mon-gear.cc
index a487a0f9cb..84d1f69e0b 100644
--- a/crawl-ref/source/mon-gear.cc
+++ b/crawl-ref/source/mon-gear.cc
@@ -111,7 +111,7 @@ static void _give_scroll(monster* mon, int level)
int which_book = (one_chance_in(3) ? BOOK_TRANSFIGURATIONS
: BOOK_EARTH);
- thing_created = items(0, OBJ_BOOKS, which_book, true, level);
+ thing_created = items(false, OBJ_BOOKS, which_book, level);
if (thing_created != NON_ITEM && coinflip())
{
@@ -124,7 +124,7 @@ static void _give_scroll(monster* mon, int level)
}
else if (mons_is_unique(mon->type) && one_chance_in(3)
&& _should_give_unique_item(mon))
- thing_created = items(0, OBJ_SCROLLS, OBJ_RANDOM, true, level);
+ thing_created = items(false, OBJ_SCROLLS, OBJ_RANDOM, level);
if (thing_created == NON_ITEM)
return;
@@ -152,7 +152,7 @@ static void _give_wand(monster* mon, int level)
while (1)
{
- const int idx = items(0, OBJ_WANDS, OBJ_RANDOM, true, level);
+ const int idx = items(false, OBJ_WANDS, OBJ_RANDOM, level);
if (idx == NON_ITEM)
return;
@@ -183,7 +183,7 @@ static void _give_potion(monster* mon, int level)
{
// This handles initialization of stack timer.
const int thing_created =
- items(0, OBJ_POTIONS, POT_BLOOD, true, level);
+ items(false, OBJ_POTIONS, POT_BLOOD, level);
if (thing_created == NON_ITEM)
return;
@@ -194,8 +194,8 @@ static void _give_potion(monster* mon, int level)
else if (mon->type == MONS_GNOLL_SERGEANT && one_chance_in(3))
{
const int thing_created =
- items(0, OBJ_POTIONS, coinflip() ? POT_HEAL_WOUNDS : POT_CURING,
- true, level);
+ items(false, OBJ_POTIONS,
+ coinflip() ? POT_HEAL_WOUNDS : POT_CURING, level);
if (thing_created == NON_ITEM)
return;
@@ -206,7 +206,7 @@ static void _give_potion(monster* mon, int level)
else if (mons_is_unique(mon->type) && one_chance_in(3)
&& _should_give_unique_item(mon))
{
- const int thing_created = items(0, OBJ_POTIONS, OBJ_RANDOM, true,
+ const int thing_created = items(false, OBJ_POTIONS, OBJ_RANDOM,
level);
if (thing_created == NON_ITEM)
@@ -1533,7 +1533,7 @@ static void _give_weapon(monster* mon, int level, bool melee_only = false,
// force_item is set... otherwise we're just going to take the base
// and subtype and create a new item. - bwr
const int thing_created =
- ((force_item) ? get_mitm_slot() : items(0, xitc, xitt, true, level, 0,
+ ((force_item) ? get_mitm_slot() : items(false, xitc, xitt, level,
item.special));
if (thing_created == NON_ITEM)
@@ -1589,7 +1589,7 @@ static void _give_ammo(monster* mon, int level, bool mons_summoned)
xitt = MI_SLING_BULLET;
}
- const int thing_created = items(0, xitc, xitt, true, level);
+ const int thing_created = items(false, xitc, xitt, level);
if (thing_created == NON_ITEM)
return;
@@ -1753,7 +1753,7 @@ static void _give_ammo(monster* mon, int level, bool mons_summoned)
if (weap_type == -1)
return;
- const int thing_created = items(0, OBJ_MISSILES, weap_type, true, level);
+ const int thing_created = items(false, OBJ_MISSILES, weap_type, level);
if (thing_created != NON_ITEM)
{
@@ -1780,7 +1780,7 @@ static item_def* make_item_for_monster(
if (bp == NON_ITEM)
return 0;
- const int thing_created = items(allow_uniques, base, subtype, true, level);
+ const int thing_created = items(allow_uniques, base, subtype, level);
if (thing_created == NON_ITEM)
return 0;
@@ -2460,7 +2460,7 @@ static void _give_armour(monster* mon, int level, bool spectral_orcs, bool merc)
// force_item is set... otherwise we're just going to take the base
// and subtype and create a new item. - bwr
const int thing_created =
- ((force_item) ? get_mitm_slot() : items(0, xitc, xitt, true, level));
+ ((force_item) ? get_mitm_slot() : items(false, xitc, xitt, level));
if (thing_created == NON_ITEM)
return;
@@ -2480,7 +2480,7 @@ static void _give_armour(monster* mon, int level, bool spectral_orcs, bool merc)
static void _give_gold(monster* mon, int level)
{
- const int it = items(0, OBJ_GOLD, 0, true, level);
+ const int it = items(false, OBJ_GOLD, 0, level);
_give_monster_item(mon, it);
}
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc
index 50b12e93cd..dd7e2e2288 100644
--- a/crawl-ref/source/monster.cc
+++ b/crawl-ref/source/monster.cc
@@ -6223,7 +6223,7 @@ void monster::steal_item_from_player()
else
{
// Else create a new item for this pile of gold.
- const int idx = items(0, OBJ_GOLD, OBJ_RANDOM, true, 0);
+ const int idx = items(false, OBJ_GOLD, OBJ_RANDOM, 0);
if (idx == NON_ITEM)
return;
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index b3342f1bbf..39cfa849fc 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -1454,7 +1454,7 @@ static bool _give_nemelex_gift(bool forced = false)
2, MISC_DECK_OF_ESCAPE,
0);
- int thing_created = items(1, OBJ_MISCELLANY, gift_type, true, 1, 0, 0,
+ int thing_created = items(true, OBJ_MISCELLANY, gift_type, 1, 0,
GOD_NEMELEX_XOBEH);
move_item_to_grid(&thing_created, you.pos(), true);
@@ -1904,7 +1904,7 @@ bool do_god_gift(bool forced)
}
else
{
- int thing_created = items(1, OBJ_BOOKS, gift, true, 1, 0, 0,
+ int thing_created = items(true, OBJ_BOOKS, gift, 1, 0,
you.religion);
// Replace a Kiku gift by a custom-random book.
if (you_worship(GOD_KIKUBAAQUDGHA))
diff --git a/crawl-ref/source/wiz-item.cc b/crawl-ref/source/wiz-item.cc
index 31008ee424..e25a7aefa3 100644
--- a/crawl-ref/source/wiz-item.cc
+++ b/crawl-ref/source/wiz-item.cc
@@ -52,7 +52,7 @@ static void _make_all_books()
if (i == BOOK_WAR_CHANTS || i == BOOK_STALKING)
continue;
#endif
- int thing = items(0, OBJ_BOOKS, i, true, 0, 0, 0, AQ_WIZMODE);
+ int thing = items(false, OBJ_BOOKS, i, 0, 0, AQ_WIZMODE);
if (thing == NON_ITEM)
continue;
diff --git a/crawl-ref/source/wiz-mon.cc b/crawl-ref/source/wiz-mon.cc
index 02d8c2142c..b422a0ccae 100644
--- a/crawl-ref/source/wiz-mon.cc
+++ b/crawl-ref/source/wiz-mon.cc
@@ -76,7 +76,7 @@ void wizard_create_spec_monster()
static int _make_mimic_item(object_class_type type)
{
- int it = items(0, OBJ_RANDOM, OBJ_RANDOM, true, 0, 0);
+ int it = items(false, OBJ_RANDOM, OBJ_RANDOM, 0);
if (it == NON_ITEM)
return NON_ITEM;
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index 872b45eb81..ae518910db 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -727,7 +727,7 @@ static void _xom_make_item(object_class_type base, int subtype, int power)
{
god_acting gdact(GOD_XOM);
- int thing_created = items(true, base, subtype, true, power, 0, 0, GOD_XOM);
+ int thing_created = items(true, base, subtype, power, 0, GOD_XOM);
if (feat_destroys_item(grd(you.pos()), mitm[thing_created],
!silenced(you.pos())))
@@ -1637,9 +1637,9 @@ static int _xom_snakes_to_sticks(int sever, bool debug = false)
(x_chance_in_y(3,5) ? MI_ARROW : MI_JAVELIN)
: _xom_random_stickable(mi->get_experience_level()));
- int item_slot = items(false, base_type, sub_type, true,
+ int item_slot = items(false, base_type, sub_type,
mi->get_experience_level() / 3 - 1,
- 0, 0, -1);
+ 0, -1);
if (item_slot == NON_ITEM)
continue;
diff --git a/crawl-ref/source/zotdef.cc b/crawl-ref/source/zotdef.cc
index a0e7e89620..0d5c4d4c44 100644
--- a/crawl-ref/source/zotdef.cc
+++ b/crawl-ref/source/zotdef.cc
@@ -1005,7 +1005,7 @@ void zotdef_bosses_check()
const char *msg = "You sense that a powerful threat has arrived.";
if (!(((you.num_turns + 1) / ZOTDEF_CYCLE_LENGTH) % ZOTDEF_RUNE_FREQ))
{
- int ip = items(1, OBJ_MISCELLANY, MISC_RUNE_OF_ZOT, true, 0);
+ int ip = items(true, OBJ_MISCELLANY, MISC_RUNE_OF_ZOT, 0);
int *const item_made = &ip;
if (*item_made != NON_ITEM && *item_made != -1)
{