1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-10 12:39:53 +00:00

Merge branch 'freeunrealestate' into 'master'

Don't check magicka when casting free spells

Closes #5841

See merge request OpenMW/openmw!589
This commit is contained in:
psi29a 2021-02-07 21:54:52 +00:00
commit 4b7d00530d
4 changed files with 6 additions and 2 deletions

View File

@ -101,6 +101,7 @@
Bug #5835: OpenMW doesn't accept negative values for NPC's hello, alarm, fight, and flee
Bug #5836: OpenMW dialogue/greeting/voice filter doesn't accept negative Ai values for NPC's hello, alarm, fight, and flee
Bug #5840: GetSoundPlaying "Health Damage" doesn't play when NPC hits target with shield effect ( vanilla engine behavior )
Bug #5841: Can't Cast Zero Cost Spells When Magicka is < 0
Feature #390: 3rd person look "over the shoulder"
Feature #1536: Show more information about level on menu
Feature #2386: Distant Statics in the form of Object Paging

View File

@ -123,7 +123,7 @@ namespace MWMechanics
if (spell->mData.mType != ESM::Spell::ST_Spell)
return 100;
if (checkMagicka && stats.getMagicka().getCurrent() < spell->mData.mCost)
if (checkMagicka && spell->mData.mCost > 0 && stats.getMagicka().getCurrent() < spell->mData.mCost)
return 0;
if (spell->mData.mFlags & ESM::Spell::F_Always)

View File

@ -187,6 +187,9 @@ namespace MWScript
.getCreatureStats(ptr)
.getDynamic(mIndex)
.getCurrent();
// GetMagicka shouldn't return negative values
if(mIndex == 1 && value < 0)
value = 0;
}
runtime.push (value);
}

View File

@ -3009,7 +3009,7 @@ namespace MWWorld
// Check mana
bool godmode = (isPlayer && mGodMode);
MWMechanics::DynamicStat<float> magicka = stats.getMagicka();
if (magicka.getCurrent() < spell->mData.mCost && !godmode)
if (spell->mData.mCost > 0 && magicka.getCurrent() < spell->mData.mCost && !godmode)
{
message = "#{sMagicInsufficientSP}";
fail = true;