From: <gi...@cr...> - 2012-02-25 22:10:51
|
via 7b76f4f8ae13ce9c3ba9605f4ad1a31017556061 (commit) via 70ed650a2abf6326ae70dada882e092f1033715f (commit) from 8af5db4e553cab59639916120ad6e74f8bb72f4c (commit) ----------------------------------------------------------------------- commit 7b76f4f8ae13ce9c3ba9605f4ad1a31017556061 Author: David Lawrence Ramsey <dol...@us...> Date: Sat Feb 25 16:05:06 2012 -0600 Add minor cosmetic fixes. commit 70ed650a2abf6326ae70dada882e092f1033715f Author: David Lawrence Ramsey <dol...@us...> Date: Sat Feb 25 16:04:34 2012 -0600 Remove unneeded goto. ----------------------------------------------------------------------- Summary of changes: crawl-ref/source/makeitem.cc | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc index d37b697..c2e83f3 100644 --- a/crawl-ref/source/makeitem.cc +++ b/crawl-ref/source/makeitem.cc @@ -1551,11 +1551,11 @@ static void _generate_weapon_item(item_def& item, bool allow_uniques, { item.sub_type = _determine_weapon_subtype(item_level); if (is_weapon_brand_ok(item.sub_type, item.special, true)) - goto brand_ok; + break; } - item.sub_type = SPWPN_NORMAL; // fall back to no brand + if (i == 1000) + item.sub_type = SPWPN_NORMAL; // fall back to no brand } -brand_ok: // Forced randart. if (item_level == -6) @@ -2315,7 +2315,7 @@ static void _generate_armour_item(item_def& item, bool allow_uniques, else { int i; - for (i=0; i<1000; i++) + for (i = 0; i < 1000; ++i) { item.sub_type = get_random_armour_type(item_level); if (is_armour_brand_ok(item.sub_type, item.special, true)) @@ -2327,7 +2327,7 @@ static void _generate_armour_item(item_def& item, bool allow_uniques, if (item_level == -6) { int i; - for (i=0; i<100; i++) + for (i = 0; i < 100; ++i) if (_try_make_armour_artefact(item, force_type, 0, true) && is_artefact(item)) return; // fall back to an ordinary item @@ -3604,7 +3604,7 @@ void makeitem_tests() item_def item; mpr("Running generate_weapon_item tests."); - for (i=0;i<10000;i++) + for (i = 0; i < 10000; ++i) { item.clear(); level = _test_item_level(); @@ -3621,7 +3621,7 @@ void makeitem_tests() } mpr("Running generate_armour_item tests."); - for (i=0;i<10000;i++) + for (i = 0; i < 10000; ++i) { item.clear(); level = _test_item_level(); -- Dungeon Crawl Stone Soup |