mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-01 08:45:32 +00:00
Fix bug 1482:
- put powers on cooldown only when they are used succedsfully
This commit is contained in:
parent
0f2305ae43
commit
e24173f94a
1 changed files with 7 additions and 8 deletions
|
@ -2316,16 +2316,11 @@ namespace MWWorld
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this is a power, check if it was already used in the last 24h
|
// If this is a power, check if it was already used in the last 24h
|
||||||
if (!fail && spell->mData.mType == ESM::Spell::ST_Power)
|
if (!fail && spell->mData.mType == ESM::Spell::ST_Power && !stats.getSpells().canUsePower(spell->mId))
|
||||||
{
|
|
||||||
if (stats.getSpells().canUsePower(spell->mId))
|
|
||||||
stats.getSpells().usePower(spell->mId);
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
message = "#{sPowerAlreadyUsed}";
|
message = "#{sPowerAlreadyUsed}";
|
||||||
fail = true;
|
fail = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Reduce mana
|
// Reduce mana
|
||||||
if (!fail)
|
if (!fail)
|
||||||
|
@ -2358,6 +2353,10 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
const ESM::Spell* spell = getStore().get<ESM::Spell>().search(selectedSpell);
|
const ESM::Spell* spell = getStore().get<ESM::Spell>().search(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);
|
cast.cast(spell);
|
||||||
}
|
}
|
||||||
else if (actor.getClass().hasInventoryStore(actor))
|
else if (actor.getClass().hasInventoryStore(actor))
|
||||||
|
|
Loading…
Reference in a new issue