1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 18:19:55 +00:00

Fix being affected by Silence in god mode

This commit is contained in:
scrawl 2017-02-21 15:48:45 +01:00
parent b9740fd2a1
commit eefe1ed1a8

View file

@ -95,8 +95,6 @@ namespace MWMechanics
int actorLuck = stats.getAttribute(ESM::Attribute::Luck).getModified();
float castChance = (lowestSkill - spell->mData.mCost + castBonus + 0.2f * actorWillpower + 0.1f * actorLuck) * stats.getFatigueTerm();
if (MWBase::Environment::get().getWorld()->getGodModeState() && actor == getPlayer())
castChance = 100;
if (!cap)
return std::max(0.f, castChance);
@ -816,12 +814,15 @@ namespace MWMechanics
bool fail = false;
// Check success
float successChance = getSpellSuccessChance(spell, mCaster);
if (Misc::Rng::roll0to99() >= successChance)
if (!(mCaster == getPlayer() && MWBase::Environment::get().getWorld()->getGodModeState()))
{
if (mCaster == getPlayer())
MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicSkillFail}");
fail = true;
float successChance = getSpellSuccessChance(spell, mCaster);
if (Misc::Rng::roll0to99() >= successChance)
{
if (mCaster == getPlayer())
MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicSkillFail}");
fail = true;
}
}
if (fail)