1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-14 15:40:18 +00:00

Invalid iterator fix

This commit is contained in:
scrawl 2014-08-28 02:09:00 +02:00
parent 2e623bac5a
commit 1a98f8ca93

View File

@ -289,7 +289,7 @@ namespace MWMechanics
// FIXME: consider moving this stuff to ActionWeapon::getCombatRange // FIXME: consider moving this stuff to ActionWeapon::getCombatRange
const ESM::Weapon *weapon = NULL; const ESM::Weapon *weapon = NULL;
MWMechanics::WeaponType weaptype; MWMechanics::WeaponType weaptype = WeapType_None;
float weapRange = 1.0f; float weapRange = 1.0f;
// Get weapon characteristics // Get weapon characteristics
@ -308,7 +308,7 @@ namespace MWMechanics
world->getStore().get<ESM::GameSetting>().find("fHandToHandReach")->getFloat(); world->getStore().get<ESM::GameSetting>().find("fHandToHandReach")->getFloat();
weapRange = fHandToHandReach; weapRange = fHandToHandReach;
} }
else if (weaptype != WeapType_PickProbe && weaptype != WeapType_Spell) else if (weaptype != WeapType_PickProbe && weaptype != WeapType_Spell && weaptype != WeapType_None)
{ {
// All other WeapTypes are actually weapons, so get<ESM::Weapon> is safe. // All other WeapTypes are actually weapons, so get<ESM::Weapon> is safe.
weapon = weaponSlot->get<ESM::Weapon>()->mBase; weapon = weaponSlot->get<ESM::Weapon>()->mBase;