forked from mirror/openmw-tes3mp
getSpellSuccessChance return 0 for used powers (Fixes #2944)
This commit is contained in:
parent
77cb438714
commit
7b6fe149f2
2 changed files with 7 additions and 4 deletions
|
@ -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…
Reference in a new issue