mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-07-08 13:21:35 +00:00
[Client] Stop processing CastSpell::inflict() in more appropriate place
This preserves the functionality of Reflect effects, which relies on inflict() getting far enough for a dedicated player or actor, without also processing parts of inflict() that should be skipped for them.
This commit is contained in:
parent
7f017217c7
commit
eb005a5c33
1 changed files with 17 additions and 31 deletions
|
@ -180,6 +180,19 @@ namespace MWMechanics
|
||||||
if (!reflected && reflectEffect(*effectIt, magicEffect, caster, target, reflectedEffects))
|
if (!reflected && reflectEffect(*effectIt, magicEffect, caster, target, reflectedEffects))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Start of tes3mp addition
|
||||||
|
|
||||||
|
Now that reflected effects have been handled, don't unilaterally process effects further for dedicated players
|
||||||
|
and actors on this client and instead expect their effects to be applied correctly through the SpellsActive
|
||||||
|
packets received
|
||||||
|
*/
|
||||||
|
if (mwmp::PlayerList::isDedicatedPlayer(target) || mwmp::Main::get().getCellController()->isDedicatedActor(target))
|
||||||
|
continue;
|
||||||
|
/*
|
||||||
|
End of tes3mp addition
|
||||||
|
*/
|
||||||
|
|
||||||
// Try resisting.
|
// Try resisting.
|
||||||
float magnitudeMult = getEffectMultiplier(effectIt->mEffectID, target, caster, spell, &targetEffects);
|
float magnitudeMult = getEffectMultiplier(effectIt->mEffectID, target, caster, spell, &targetEffects);
|
||||||
if (magnitudeMult == 0)
|
if (magnitudeMult == 0)
|
||||||
|
@ -187,17 +200,8 @@ namespace MWMechanics
|
||||||
// Fully resisted, show message
|
// Fully resisted, show message
|
||||||
if (target == getPlayer())
|
if (target == getPlayer())
|
||||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicPCResisted}");
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicPCResisted}");
|
||||||
/*
|
else if (castByPlayer)
|
||||||
Start of tes3mp change (major)
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicTargetResisted}");
|
||||||
|
|
||||||
Don't display messages about whether the target has resisted the local player's spell or not,
|
|
||||||
because this client has no way of knowing here whether that has happened
|
|
||||||
*/
|
|
||||||
//else if (castByPlayer)
|
|
||||||
// MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicTargetResisted}");
|
|
||||||
/*
|
|
||||||
End of tes3mp change (major)
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -248,16 +252,7 @@ namespace MWMechanics
|
||||||
if (!appliedOnce)
|
if (!appliedOnce)
|
||||||
effect.mDuration = std::max(1.f, effect.mDuration);
|
effect.mDuration = std::max(1.f, effect.mDuration);
|
||||||
|
|
||||||
/*
|
if (effect.mDuration == 0)
|
||||||
Start of tes3mp change (major)
|
|
||||||
|
|
||||||
If the target is a DedicatedPlayer or DedicatedActor, don't apply effects to them unilaterally on this
|
|
||||||
client and wait for the server's response to the other client to apply the effects for us
|
|
||||||
*/
|
|
||||||
if (effect.mDuration == 0 && !mwmp::PlayerList::isDedicatedPlayer(target) && !mwmp::Main::get().getCellController()->isDedicatedActor(target))
|
|
||||||
/*
|
|
||||||
End of tes3mp change (major)
|
|
||||||
*/
|
|
||||||
{
|
{
|
||||||
// We still should add effect to list to allow GetSpellEffects to detect this spell
|
// We still should add effect to list to allow GetSpellEffects to detect this spell
|
||||||
appliedLastingEffects.push_back(effect);
|
appliedLastingEffects.push_back(effect);
|
||||||
|
@ -294,16 +289,7 @@ namespace MWMechanics
|
||||||
if (!wasDead && isDead)
|
if (!wasDead && isDead)
|
||||||
MWBase::Environment::get().getMechanicsManager()->actorKilled(target, caster);
|
MWBase::Environment::get().getMechanicsManager()->actorKilled(target, caster);
|
||||||
}
|
}
|
||||||
/*
|
else
|
||||||
Start of tes3mp change (major)
|
|
||||||
|
|
||||||
If the target is a DedicatedPlayer or DedicatedActor, don't apply effects to them unilaterally on this
|
|
||||||
client and wait for the server's response to the other client to apply the effects for us
|
|
||||||
*/
|
|
||||||
else if (!mwmp::PlayerList::isDedicatedPlayer(target) && !mwmp::Main::get().getCellController()->isDedicatedActor(target))
|
|
||||||
/*
|
|
||||||
End of tes3mp change (major)
|
|
||||||
*/
|
|
||||||
{
|
{
|
||||||
effect.mTimeLeft = effect.mDuration;
|
effect.mTimeLeft = effect.mDuration;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue