1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 20:19:57 +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(); int actorLuck = stats.getAttribute(ESM::Attribute::Luck).getModified();
float castChance = (lowestSkill - spell->mData.mCost + castBonus + 0.2f * actorWillpower + 0.1f * actorLuck) * stats.getFatigueTerm(); 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) if (!cap)
return std::max(0.f, castChance); return std::max(0.f, castChance);
@ -816,12 +814,15 @@ namespace MWMechanics
bool fail = false; bool fail = false;
// Check success // Check success
float successChance = getSpellSuccessChance(spell, mCaster); if (!(mCaster == getPlayer() && MWBase::Environment::get().getWorld()->getGodModeState()))
if (Misc::Rng::roll0to99() >= successChance)
{ {
if (mCaster == getPlayer()) float successChance = getSpellSuccessChance(spell, mCaster);
MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicSkillFail}"); if (Misc::Rng::roll0to99() >= successChance)
fail = true; {
if (mCaster == getPlayer())
MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicSkillFail}");
fail = true;
}
} }
if (fail) if (fail)