Fix exception when casting Bound Gloves spell

deque
scrawl 11 years ago
parent c69a311ad8
commit 11b05c352f

@ -530,8 +530,12 @@ namespace MWMechanics
itemGmst)->getString();
if (it->first == ESM::MagicEffect::BoundGloves)
{
adjustBoundItem("sMagicBoundLeftGauntletID", magnitude > 0, ptr);
adjustBoundItem("sMagicBoundRightGauntletID", magnitude > 0, ptr);
item = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find(
"sMagicBoundLeftGauntletID")->getString();
adjustBoundItem(item, magnitude > 0, ptr);
item = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find(
"sMagicBoundRightGauntletID")->getString();
adjustBoundItem(item, magnitude > 0, ptr);
}
else
adjustBoundItem(item, magnitude > 0, ptr);

@ -78,7 +78,7 @@ namespace MWWorld
state.mSourceName = sourceName;
state.mId = model;
state.mSpellId = spellId;
state.mCaster = caster;
state.mCasterHandle = caster.getRefData().getHandle();
if (caster.getClass().isActor())
state.mActorId = caster.getClass().getCreatureStats(caster).getActorId();
else
@ -162,7 +162,7 @@ namespace MWWorld
{
MWWorld::Ptr obstacle = MWBase::Environment::get().getWorld()->searchPtrViaHandle(cIt->second);
MWWorld::Ptr caster = it->mCaster;
MWWorld::Ptr caster = MWBase::Environment::get().getWorld()->searchPtrViaHandle(it->mCasterHandle);
if (caster.isEmpty())
caster = MWBase::Environment::get().getWorld()->searchPtrViaActorId(it->mActorId);

@ -67,12 +67,12 @@ namespace MWWorld
int mActorId;
// actorId doesn't work for non-actors, so we also keep track of the Ptr.
// actorId doesn't work for non-actors, so we also keep track of the Ogre-handle.
// For non-actors, the caster ptr is mainly needed to prevent the projectile
// from colliding with its caster.
// TODO: this will break when the game is saved and reloaded, since there is currently
// no way to write identifiers for non-actors to a savegame.
MWWorld::Ptr mCaster;
std::string mCasterHandle;
// MW-id of this projectile
std::string mId;

Loading…
Cancel
Save