From fe5647c376e6492945e28ddc5e4c4d97888e24d4 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Mon, 12 Jan 2009 21:11:00 +0000 Subject: Fix 2502110: " attempting to gift invalid type of item" with infinite loop. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@8430 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/randart.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crawl-ref/source/randart.cc b/crawl-ref/source/randart.cc index ba240dbe49..46e32f9fb1 100644 --- a/crawl-ref/source/randart.cc +++ b/crawl-ref/source/randart.cc @@ -95,7 +95,8 @@ static bool _god_fits_artefact(const god_type which_god, const item_def &item, if (type_bad && !name_check_only) { ASSERT(!"God attempting to gift invalid type of item."); - mprf(MSGCH_ERROR, "%s attempting to gift invalid type of item."); + mprf(MSGCH_ERROR, "%s attempting to gift invalid type of item.", + god_name(which_god).c_str()); // Prevent infinite loop in make_item_randart() return (true); } @@ -276,7 +277,7 @@ static std::string _replace_name_parts(const std::string name_in, { which_god = static_cast(random2(NUM_GODS - 1) + 1); } - while (!_god_fits_artefact(which_god, item), true); + while (!_god_fits_artefact(which_god, item, true)); } name = replace_all(name, "@god_name@", god_name(which_god, false)); -- cgit v1.2.3