mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-29 09:32:45 +00:00
Fix Tribunal/BM summon effects not working
This commit is contained in:
parent
e203127952
commit
378e91545d
@ -23,7 +23,7 @@ namespace ESSImport
|
|||||||
if (esm.isNextSub("LVCR"))
|
if (esm.isNextSub("LVCR"))
|
||||||
{
|
{
|
||||||
// occurs on leveled creature spawner references
|
// occurs on leveled creature spawner references
|
||||||
// probably some identifier for the the creature that has been spawned?
|
// probably some identifier for the creature that has been spawned?
|
||||||
unsigned char lvcr;
|
unsigned char lvcr;
|
||||||
esm.getHT(lvcr);
|
esm.getHT(lvcr);
|
||||||
//std::cout << "LVCR: " << (int)lvcr << std::endl;
|
//std::cout << "LVCR: " << (int)lvcr << std::endl;
|
||||||
|
@ -472,9 +472,7 @@ namespace MWMechanics
|
|||||||
applyInstantEffect(target, caster, EffectKey(*effectIt), magnitude);
|
applyInstantEffect(target, caster, EffectKey(*effectIt), magnitude);
|
||||||
|
|
||||||
// Re-casting a summon effect will remove the creature from previous castings of that effect.
|
// Re-casting a summon effect will remove the creature from previous castings of that effect.
|
||||||
if (effectIt->mEffectID >= ESM::MagicEffect::SummonScamp
|
if (isSummoningEffect(effectIt->mEffectID) && !target.isEmpty() && target.getClass().isActor())
|
||||||
&& effectIt->mEffectID <= ESM::MagicEffect::SummonStormAtronach
|
|
||||||
&& !target.isEmpty() && target.getClass().isActor())
|
|
||||||
{
|
{
|
||||||
CreatureStats& targetStats = target.getClass().getCreatureStats(target);
|
CreatureStats& targetStats = target.getClass().getCreatureStats(target);
|
||||||
std::map<CreatureStats::SummonKey, int>::iterator found = targetStats.getSummonedCreatureMap().find(std::make_pair(effectIt->mEffectID, mId));
|
std::map<CreatureStats::SummonKey, int>::iterator found = targetStats.getSummonedCreatureMap().find(std::make_pair(effectIt->mEffectID, mId));
|
||||||
@ -956,4 +954,13 @@ namespace MWMechanics
|
|||||||
|
|
||||||
return static_cast<int>((result < 1) ? 1 : result);
|
return static_cast<int>((result < 1) ? 1 : result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isSummoningEffect(int effectId)
|
||||||
|
{
|
||||||
|
return ((effectId >= ESM::MagicEffect::SummonScamp
|
||||||
|
&& effectId <= ESM::MagicEffect::SummonStormAtronach)
|
||||||
|
|| effectId == ESM::MagicEffect::SummonCenturionSphere
|
||||||
|
|| (effectId >= ESM::MagicEffect::SummonFabricant
|
||||||
|
&& effectId <= ESM::MagicEffect::SummonCreature05));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,8 @@ namespace MWMechanics
|
|||||||
|
|
||||||
ESM::Skill::SkillEnum spellSchoolToSkill(int school);
|
ESM::Skill::SkillEnum spellSchoolToSkill(int school);
|
||||||
|
|
||||||
|
bool isSummoningEffect(int effectId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param spell spell to cast
|
* @param spell spell to cast
|
||||||
* @param actor calculate spell success chance for this actor (depends on actor's skills)
|
* @param actor calculate spell success chance for this actor (depends on actor's skills)
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/world.hpp"
|
#include "../mwbase/world.hpp"
|
||||||
|
|
||||||
|
#include "../mwmechanics/spellcasting.hpp"
|
||||||
|
|
||||||
#include "../mwworld/esmstore.hpp"
|
#include "../mwworld/esmstore.hpp"
|
||||||
#include "../mwworld/class.hpp"
|
#include "../mwworld/class.hpp"
|
||||||
#include "../mwworld/manualref.hpp"
|
#include "../mwworld/manualref.hpp"
|
||||||
@ -51,8 +53,7 @@ namespace MWMechanics
|
|||||||
|
|
||||||
void UpdateSummonedCreatures::visit(EffectKey key, const std::string &sourceName, const std::string &sourceId, int casterActorId, float magnitude, float remainingTime, float totalTime)
|
void UpdateSummonedCreatures::visit(EffectKey key, const std::string &sourceName, const std::string &sourceId, int casterActorId, float magnitude, float remainingTime, float totalTime)
|
||||||
{
|
{
|
||||||
if (key.mId >= ESM::MagicEffect::SummonScamp
|
if (isSummoningEffect(key.mId) && magnitude > 0)
|
||||||
&& key.mId <= ESM::MagicEffect::SummonStormAtronach && magnitude > 0)
|
|
||||||
{
|
{
|
||||||
mActiveEffects.insert(std::make_pair(key.mId, sourceId));
|
mActiveEffects.insert(std::make_pair(key.mId, sourceId));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user