[Client] Don't cast non-weapons to weapons in isUsingRangedWeapon()

This makes lockpicks and probes work again.
experimental-mono
David Cernat 6 years ago
parent 292536439e
commit e402a17757

@ -83,7 +83,7 @@ bool MechanicsHelper::isUsingRangedWeapon(const MWWorld::Ptr& ptr)
MWWorld::ContainerStoreIterator weaponSlot = inventoryStore.getSlot(
MWWorld::InventoryStore::Slot_CarriedRight);
if (weaponSlot != inventoryStore.end())
if (weaponSlot != inventoryStore.end() && weaponSlot->getTypeName() == typeid(ESM::Weapon).name())
{
const ESM::Weapon* weaponRecord = weaponSlot->get<ESM::Weapon>()->mBase;

Loading…
Cancel
Save