getSpellSuccessChance return 0 for used powers (Fixes #2944)

openmw-37
scrawl 9 years ago
parent 77cb438714
commit 7b6fe149f2

@ -123,6 +123,9 @@ namespace MWMechanics
}
}
if (spell->mData.mType == ESM::Spell::ST_Power)
return stats.getSpells().canUsePower(spell->mId) ? 100 : 0;
if (spell->mData.mType != ESM::Spell::ST_Spell)
return 100;
@ -817,6 +820,10 @@ namespace MWMechanics
sndMgr->playSound3D(mCaster, "Spell Failure " + schools[school], 1.0f, 1.0f);
return false;
}
// A power can be used once per 24h
if (spell->mData.mType == ESM::Spell::ST_Power)
stats.getSpells().usePower(spell->mId);
}
if (mCaster == getPlayer() && spellIncreasesSkill(spell))

@ -2660,10 +2660,6 @@ namespace MWWorld
{
const ESM::Spell* spell = getStore().get<ESM::Spell>().find(selectedSpell);
// A power can be used once per 24h
if (spell->mData.mType == ESM::Spell::ST_Power)
stats.getSpells().usePower(spell->mId);
cast.cast(spell);
}
else if (actor.getClass().hasInventoryStore(actor))

Loading…
Cancel
Save