diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-15 10:02:19 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-15 10:02:19 +0000 |
commit | cf4b68bb3c2e5d1955d41fff7284a7d56a484b3f (patch) | |
tree | fb403a4d82b266bec7478b92b75b513c55acdb59 /crawl-ref/source/misc.cc | |
parent | bc30076f91a48a0e05a88317d2048f7bcafc06c7 (diff) | |
download | crawl-ref-cf4b68bb3c2e5d1955d41fff7284a7d56a484b3f.tar.gz crawl-ref-cf4b68bb3c2e5d1955d41fff7284a7d56a484b3f.zip |
Various cleanups, mostly having to do with coord_def().
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9086 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r-- | crawl-ref/source/misc.cc | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index a3c77d2036..c5650baf26 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -306,32 +306,30 @@ void maybe_coagulate_blood_potions_floor(int obj) // Now that coagulating is necessary, check square for // !coagulated blood. ASSERT(blood.pos.x >= 0 && blood.pos.y >= 0); - for (int o = igrd[blood.pos.x][blood.pos.y]; o != NON_ITEM; - o = mitm[o].link) + for (stack_iterator si(blood.pos); si; ++si) { - if (mitm[o].base_type == OBJ_POTIONS - && mitm[o].sub_type == POT_BLOOD_COAGULATED) + if (si->base_type == OBJ_POTIONS + && si->sub_type == POT_BLOOD_COAGULATED) { // Merge with existing stack. - CrawlHashTable &props2 = mitm[o].props; + CrawlHashTable &props2 = si->props; if (!props2.exists("timer")) - init_stack_blood_potions(mitm[o], mitm[o].special); + init_stack_blood_potions(*si, si->special); ASSERT(props2.exists("timer")); CrawlVector &timer2 = props2["timer"].get_vector(); - ASSERT(timer2.size() == mitm[o].quantity); + ASSERT(timer2.size() == si->quantity); // Update timer -> push(pop). - long val; while (!age_timer.empty()) { - val = age_timer[age_timer.size() - 1]; + const long val = age_timer.back(); age_timer.pop_back(); timer2.push_back(val); } _long_sort(timer2); - inc_mitm_item_quantity(o, coag_count); - ASSERT(timer2.size() == mitm[o].quantity); + inc_mitm_item_quantity(si.link(), coag_count); + ASSERT(timer2.size() == si->quantity); dec_mitm_item_quantity(obj, rot_count + coag_count); return; } |