summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/effects.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-09 11:52:47 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-09 11:52:47 +0000
commit37b869723d4dc21ae205cd632f016d050f754fcc (patch)
treebcc9cae590590b7fb0d87af68441efdf8fea8729 /crawl-ref/source/effects.cc
parent197e914235a08d505781e2b75b69998e8452b051 (diff)
downloadcrawl-ref-37b869723d4dc21ae205cd632f016d050f754fcc.tar.gz
crawl-ref-37b869723d4dc21ae205cd632f016d050f754fcc.zip
[1739347] Fixed acquirement giving unwieldable weapons.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1814 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc18
1 files changed, 14 insertions, 4 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 6b5825d3a7..da910dbd3d 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -22,6 +22,7 @@
#include "beam.h"
#include "direct.h"
#include "hiscores.h"
+#include "item_use.h"
#include "itemname.h"
#include "itemprop.h"
#include "items.h"
@@ -1143,7 +1144,7 @@ bool acquirement(object_class_type force_class, int agent)
else
{
randart_properties_t proprt;
- for (int item_tries = 0; item_tries < 50; item_tries++)
+ for (int item_tries = 0; item_tries < 200; item_tries++)
{
// BCR - unique is now used for food quantity.
thing_created = items( unique, class_wanted, type_wanted, true,
@@ -1152,12 +1153,21 @@ bool acquirement(object_class_type force_class, int agent)
if (thing_created == NON_ITEM)
continue;
+ const item_def &doodad(mitm[thing_created]);
+ if (doodad.base_type == OBJ_WEAPONS
+ && !can_wield(&doodad, false, true))
+ {
+ destroy_item(thing_created);
+ thing_created = NON_ITEM;
+ continue;
+ }
+
// MT - Check: god-gifted weapons and armor shouldn't kill you.
// Except Xom.
if ((agent == GOD_TROG || agent == GOD_OKAWARU)
- && is_random_artefact(mitm[thing_created]))
+ && is_random_artefact(doodad))
{
- randart_wpn_properties( mitm[thing_created], proprt );
+ randart_wpn_properties( doodad, proprt );
// check vs stats. positive stats will automatically fall
// through. As will negative stats that won't kill you.
@@ -1176,7 +1186,7 @@ bool acquirement(object_class_type force_class, int agent)
if (thing_created == NON_ITEM)
{
- mpr("The demon of the infinite void smiles at you.");
+ mpr("The demon of the infinite void smiles upon you.");
return (false);
}