1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-20 11:53:53 +00:00

Show a message when the player attempts to cast a disabled spell

This commit is contained in:
Emanuel Guevel 2014-02-11 14:51:46 +01:00
parent 8c8f4cd420
commit 6a4820c0f7

View file

@ -232,6 +232,24 @@ namespace MWMechanics
MWBase::Environment::get().getWorld()->getStore().get<ESM::MagicEffect>().find ( MWBase::Environment::get().getWorld()->getStore().get<ESM::MagicEffect>().find (
effectIt->mEffectID); 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 player is healing someone, show the target's HP bar
if (caster.getRefData().getHandle() == "player" && target != caster if (caster.getRefData().getHandle() == "player" && target != caster
&& effectIt->mEffectID == ESM::MagicEffect::RestoreHealth && effectIt->mEffectID == ESM::MagicEffect::RestoreHealth