1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-06-21 17:41:36 +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 #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 #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 #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 #390: 3rd person look "over the shoulder"
Feature #1536: Show more information about level on menu Feature #1536: Show more information about level on menu
Feature #2386: Distant Statics in the form of Object Paging 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) if (spell->mData.mType != ESM::Spell::ST_Spell)
return 100; return 100;
if (checkMagicka && stats.getMagicka().getCurrent() < spell->mData.mCost) if (checkMagicka && spell->mData.mCost > 0 && stats.getMagicka().getCurrent() < spell->mData.mCost)
return 0; return 0;
if (spell->mData.mFlags & ESM::Spell::F_Always) if (spell->mData.mFlags & ESM::Spell::F_Always)

View file

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

View file

@ -3009,7 +3009,7 @@ namespace MWWorld
// Check mana // Check mana
bool godmode = (isPlayer && mGodMode); bool godmode = (isPlayer && mGodMode);
MWMechanics::DynamicStat<float> magicka = stats.getMagicka(); 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}"; message = "#{sMagicInsufficientSP}";
fail = true; fail = true;