mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:23:51 +00:00
Merge pull request #2082 from Capostrophic/teleporting
Make magic teleportation attempts detectable even when teleportation is disabled (bug #3765)
This commit is contained in:
commit
cc214cf6b0
2 changed files with 29 additions and 27 deletions
|
@ -5,6 +5,7 @@
|
||||||
Bug #2987: Editor: some chance and AI data fields can overflow
|
Bug #2987: Editor: some chance and AI data fields can overflow
|
||||||
Bug #3623: Fix HiDPI on Windows
|
Bug #3623: Fix HiDPI on Windows
|
||||||
Bug #3733: Normal maps are inverted on mirrored UVs
|
Bug #3733: Normal maps are inverted on mirrored UVs
|
||||||
|
Bug #3765: DisableTeleporting makes Mark/Recall/Intervention effects undetectable
|
||||||
Bug #4329: Removed birthsign abilities are restored after reloading the save
|
Bug #4329: Removed birthsign abilities are restored after reloading the save
|
||||||
Bug #4383: Bow model obscures crosshair when arrow is drawn
|
Bug #4383: Bow model obscures crosshair when arrow is drawn
|
||||||
Bug #4411: Reloading a saved game while falling prevents damage in some cases
|
Bug #4411: Reloading a saved game while falling prevents damage in some cases
|
||||||
|
|
|
@ -295,17 +295,6 @@ namespace MWMechanics
|
||||||
return true; // must still apply to get visual effect and have target regard it as attack
|
return true; // must still apply to get visual effect and have target regard it as attack
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ESM::MagicEffect::AlmsiviIntervention:
|
|
||||||
case ESM::MagicEffect::DivineIntervention:
|
|
||||||
case ESM::MagicEffect::Mark:
|
|
||||||
case ESM::MagicEffect::Recall:
|
|
||||||
if (!MWBase::Environment::get().getWorld()->isTeleportingEnabled())
|
|
||||||
{
|
|
||||||
if (castByPlayer)
|
|
||||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sTeleportDisabled}");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case ESM::MagicEffect::WaterWalking:
|
case ESM::MagicEffect::WaterWalking:
|
||||||
if (target.getClass().isPureWaterCreature(target) && MWBase::Environment::get().getWorld()->isSwimming(target))
|
if (target.getClass().isPureWaterCreature(target) && MWBase::Environment::get().getWorld()->isSwimming(target))
|
||||||
return false;
|
return false;
|
||||||
|
@ -747,21 +736,19 @@ namespace MWMechanics
|
||||||
else if (target.getClass().isActor() && target == getPlayer())
|
else if (target.getClass().isActor() && target == getPlayer())
|
||||||
{
|
{
|
||||||
MWRender::Animation* anim = MWBase::Environment::get().getWorld()->getAnimation(mCaster);
|
MWRender::Animation* anim = MWBase::Environment::get().getWorld()->getAnimation(mCaster);
|
||||||
|
bool teleportingEnabled = MWBase::Environment::get().getWorld()->isTeleportingEnabled();
|
||||||
|
|
||||||
if (effectId == ESM::MagicEffect::DivineIntervention)
|
if (effectId == ESM::MagicEffect::DivineIntervention || effectId == ESM::MagicEffect::AlmsiviIntervention)
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getWorld()->teleportToClosestMarker(target, "divinemarker");
|
if (!teleportingEnabled)
|
||||||
anim->removeEffect(ESM::MagicEffect::DivineIntervention);
|
{
|
||||||
const ESM::Static* fx = MWBase::Environment::get().getWorld()->getStore().get<ESM::Static>()
|
if (caster == getPlayer())
|
||||||
.search("VFX_Summon_end");
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sTeleportDisabled}");
|
||||||
if (fx)
|
|
||||||
anim->addEffect("meshes\\" + fx->mModel, -1);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (effectId == ESM::MagicEffect::AlmsiviIntervention)
|
std::string marker = (effectId == ESM::MagicEffect::DivineIntervention) ? "divinemarker" : "templemarker";
|
||||||
{
|
MWBase::Environment::get().getWorld()->teleportToClosestMarker(target, marker);
|
||||||
MWBase::Environment::get().getWorld()->teleportToClosestMarker(target, "templemarker");
|
anim->removeEffect(effectId);
|
||||||
anim->removeEffect(ESM::MagicEffect::AlmsiviIntervention);
|
|
||||||
const ESM::Static* fx = MWBase::Environment::get().getWorld()->getStore().get<ESM::Static>()
|
const ESM::Static* fx = MWBase::Environment::get().getWorld()->getStore().get<ESM::Static>()
|
||||||
.search("VFX_Summon_end");
|
.search("VFX_Summon_end");
|
||||||
if (fx)
|
if (fx)
|
||||||
|
@ -769,13 +756,27 @@ namespace MWMechanics
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (effectId == ESM::MagicEffect::Mark)
|
else if (effectId == ESM::MagicEffect::Mark)
|
||||||
|
{
|
||||||
|
if (teleportingEnabled)
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getWorld()->getPlayer().markPosition(
|
MWBase::Environment::get().getWorld()->getPlayer().markPosition(
|
||||||
target.getCell(), target.getRefData().getPosition());
|
target.getCell(), target.getRefData().getPosition());
|
||||||
|
}
|
||||||
|
else if (caster == getPlayer())
|
||||||
|
{
|
||||||
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sTeleportDisabled}");
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (effectId == ESM::MagicEffect::Recall)
|
else if (effectId == ESM::MagicEffect::Recall)
|
||||||
{
|
{
|
||||||
|
if (!teleportingEnabled)
|
||||||
|
{
|
||||||
|
if (caster == getPlayer())
|
||||||
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sTeleportDisabled}");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
MWWorld::CellStore* markedCell = nullptr;
|
MWWorld::CellStore* markedCell = nullptr;
|
||||||
ESM::Position markedPosition;
|
ESM::Position markedPosition;
|
||||||
|
|
||||||
|
@ -785,7 +786,7 @@ namespace MWMechanics
|
||||||
MWWorld::ActionTeleport action(markedCell->isExterior() ? "" : markedCell->getCell()->mName,
|
MWWorld::ActionTeleport action(markedCell->isExterior() ? "" : markedCell->getCell()->mName,
|
||||||
markedPosition, false);
|
markedPosition, false);
|
||||||
action.execute(target);
|
action.execute(target);
|
||||||
anim->removeEffect(ESM::MagicEffect::Recall);
|
anim->removeEffect(effectId);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue