mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-20 08:53:52 +00:00
Show a message when the player attempts to cast a disabled spell
This commit is contained in:
parent
8c8f4cd420
commit
6a4820c0f7
1 changed files with 18 additions and 0 deletions
|
@ -232,6 +232,24 @@ namespace MWMechanics
|
|||
MWBase::Environment::get().getWorld()->getStore().get<ESM::MagicEffect>().find (
|
||||
effectIt->mEffectID);
|
||||
|
||||
if (!MWBase::Environment::get().getWorld()->isLevitationEnabled() && effectIt->mEffectID == ESM::MagicEffect::Levitate)
|
||||
{
|
||||
if (caster.getRefData().getHandle() == "player")
|
||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sLevitateDisabled}");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!MWBase::Environment::get().getWorld()->isTeleportingEnabled() &&
|
||||
(effectIt->mEffectID == ESM::MagicEffect::AlmsiviIntervention ||
|
||||
effectIt->mEffectID == ESM::MagicEffect::DivineIntervention ||
|
||||
effectIt->mEffectID == ESM::MagicEffect::Mark ||
|
||||
effectIt->mEffectID == ESM::MagicEffect::Recall))
|
||||
{
|
||||
if (caster.getRefData().getHandle() == "player")
|
||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sTeleportDisabled}");
|
||||
continue;
|
||||
}
|
||||
|
||||
// If player is healing someone, show the target's HP bar
|
||||
if (caster.getRefData().getHandle() == "player" && target != caster
|
||||
&& effectIt->mEffectID == ESM::MagicEffect::RestoreHealth
|
||||
|
|
Loading…
Reference in a new issue