v0.4.0: fixed the sad ghost sometimes giving missile weapons

This commit is contained in:
Evan Debenham 2016-06-19 00:25:05 -04:00
parent 1451928745
commit 3ce341092f

View File

@ -40,6 +40,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.armor.MailArmor;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.PlateArmor;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ScaleArmor;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.NewShortsword;
import com.shatteredpixel.shatteredpixeldungeon.levels.SewerLevel;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
@ -292,7 +293,9 @@ public class Ghost extends NPC {
}
try {
do {
weapon = (Weapon) Generator.wepTiers[wepTier - 1].classes[Random.chances(Generator.wepTiers[wepTier - 1].probs)].newInstance();
} while (!(weapon instanceof MeleeWeapon));
} catch (Exception e){
weapon = new NewShortsword();
}