summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/itemprop.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-07 07:39:15 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-07 07:39:15 +0000
commit13089bbb1b6ca36c9acad9007a887cfa44b1e30f (patch)
tree027e4e3268bdd53dc72e257a7e2cf900705bacae /crawl-ref/source/itemprop.cc
parent6ccc5b0dae20c6589de6bf594efb8940d93b72d4 (diff)
downloadcrawl-ref-13089bbb1b6ca36c9acad9007a887cfa44b1e30f.tar.gz
crawl-ref-13089bbb1b6ca36c9acad9007a887cfa44b1e30f.zip
Disallow monsters from picking up missiles for which they don't have
the necessary launcher, but allow upgrading of missiles for ones with higher pluses or branded ones. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4906 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/itemprop.cc')
-rw-r--r--crawl-ref/source/itemprop.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc
index 4108fb0738..ffa7a24a71 100644
--- a/crawl-ref/source/itemprop.cc
+++ b/crawl-ref/source/itemprop.cc
@@ -2024,7 +2024,7 @@ missile_type fires_ammo_type( weapon_type wtype )
{
item_def wpn;
wpn.base_type = OBJ_WEAPONS;
- wpn.sub_type = wtype;
+ wpn.sub_type = wtype;
return (fires_ammo_type(wpn));
}
@@ -2065,18 +2065,19 @@ const char *ammo_name(missile_type ammo)
: Missile_prop[ Missile_index[ammo] ].name);
}
-const char * ammo_name( const item_def &bow )
+const char *ammo_name( const item_def &bow )
{
ASSERT( is_range_weapon( bow ) );
return ammo_name(fires_ammo_type( bow ));
}
// returns true if item has an associated launcher
-bool has_launcher( const item_def &wpn )
+bool has_launcher( const item_def &ammo )
{
- return (wpn.sub_type != MI_LARGE_ROCK &&
- wpn.sub_type != MI_JAVELIN &&
- wpn.sub_type != MI_THROWING_NET);
+ ASSERT(ammo.base_type == OBJ_MISSILES);
+ return (ammo.sub_type != MI_LARGE_ROCK
+ && ammo.sub_type != MI_JAVELIN
+ && ammo.sub_type != MI_THROWING_NET);
}
// returns true if item can be reasonably thrown without a launcher