From 13089bbb1b6ca36c9acad9007a887cfa44b1e30f Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Wed, 7 May 2008 07:39:15 +0000 Subject: 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 --- crawl-ref/source/itemprop.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'crawl-ref/source/itemprop.cc') 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 -- cgit v1.2.3-54-g00ecf