summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-12 21:11:00 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-12 21:11:00 +0000
commitfe5647c376e6492945e28ddc5e4c4d97888e24d4 (patch)
tree0b33487940a94fa8ab84bcec4407091d2adaed73
parent6395b84a6b0960f7e8d5a4d532fb81f0e9976fa6 (diff)
downloadcrawl-ref-fe5647c376e6492945e28ddc5e4c4d97888e24d4.tar.gz
crawl-ref-fe5647c376e6492945e28ddc5e4c4d97888e24d4.zip
Fix 2502110: "<god> 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
-rw-r--r--crawl-ref/source/randart.cc5
1 files 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<god_type>(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));