From 5973285446017312e331b943ca5ddcc61469780e Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Sat, 4 Apr 2020 17:45:03 +0300 Subject: [PATCH] Move isSummoningEffect to summoning --- apps/openmw/mwmechanics/spellcasting.cpp | 10 +--------- apps/openmw/mwmechanics/spellcasting.hpp | 2 -- apps/openmw/mwmechanics/spellpriority.cpp | 1 + apps/openmw/mwmechanics/summoning.cpp | 8 +++++++- apps/openmw/mwmechanics/summoning.hpp | 2 ++ 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index 3ded41e911..d7c3bcdb11 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -27,6 +27,7 @@ #include "actorutil.hpp" #include "aifollow.hpp" #include "weapontype.hpp" +#include "summoning.hpp" namespace MWMechanics { @@ -1104,15 +1105,6 @@ namespace MWMechanics return static_cast((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)); - } - bool disintegrateSlot (MWWorld::Ptr ptr, int slot, float disintegrate) { if (ptr.getClass().hasInventoryStore(ptr)) diff --git a/apps/openmw/mwmechanics/spellcasting.hpp b/apps/openmw/mwmechanics/spellcasting.hpp index bca93c7340..804b4bca9d 100644 --- a/apps/openmw/mwmechanics/spellcasting.hpp +++ b/apps/openmw/mwmechanics/spellcasting.hpp @@ -27,8 +27,6 @@ namespace MWMechanics float calcEffectCost(const ESM::ENAMstruct& effect, const ESM::MagicEffect* magicEffect = nullptr); - bool isSummoningEffect(int effectId); - /** * @param spell spell to cast * @param actor calculate spell success chance for this actor (depends on actor's skills) diff --git a/apps/openmw/mwmechanics/spellpriority.cpp b/apps/openmw/mwmechanics/spellpriority.cpp index 7b5c38592e..f90e59971a 100644 --- a/apps/openmw/mwmechanics/spellpriority.cpp +++ b/apps/openmw/mwmechanics/spellpriority.cpp @@ -18,6 +18,7 @@ #include "spellcasting.hpp" #include "weapontype.hpp" #include "combat.hpp" +#include "summoning.hpp" namespace { diff --git a/apps/openmw/mwmechanics/summoning.cpp b/apps/openmw/mwmechanics/summoning.cpp index d4973925b3..03fd0d6819 100644 --- a/apps/openmw/mwmechanics/summoning.cpp +++ b/apps/openmw/mwmechanics/summoning.cpp @@ -13,13 +13,19 @@ #include "../mwrender/animation.hpp" -#include "spellcasting.hpp" #include "creaturestats.hpp" #include "aifollow.hpp" namespace MWMechanics { + 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)); + } + std::string getSummonedCreature(int effectId) { static const std::map summonMap diff --git a/apps/openmw/mwmechanics/summoning.hpp b/apps/openmw/mwmechanics/summoning.hpp index e638155a92..f244131207 100644 --- a/apps/openmw/mwmechanics/summoning.hpp +++ b/apps/openmw/mwmechanics/summoning.hpp @@ -11,6 +11,8 @@ namespace MWMechanics { class CreatureStats; + bool isSummoningEffect(int effectId); + std::string getSummonedCreature(int effectId); struct UpdateSummonedCreatures : public EffectSourceVisitor