Skip to content

Commit ecc9e8f

Browse files
committed
Merge branch 'silencedcode' into 'master'
Remove dead code See merge request OpenMW/openmw!4699
2 parents 79a2735 + 4e8a713 commit ecc9e8f

File tree

4 files changed

+0
-71
lines changed

4 files changed

+0
-71
lines changed

apps/openmw/mwmechanics/creaturestats.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,6 @@ namespace MWMechanics
193193
mLevel = level;
194194
}
195195

196-
void CreatureStats::modifyMagicEffects(const MagicEffects& effects)
197-
{
198-
bool recalc = effects.getOrDefault(ESM::MagicEffect::FortifyMaximumMagicka).getModifier()
199-
!= mMagicEffects.getOrDefault(ESM::MagicEffect::FortifyMaximumMagicka).getModifier();
200-
mMagicEffects.setModifiers(effects);
201-
if (recalc)
202-
recalculateMagicka();
203-
}
204-
205196
void CreatureStats::setAiSetting(AiSetting index, Stat<int> value)
206197
{
207198
mAiSettings[static_cast<std::underlying_type_t<AiSetting>>(index)] = value;

apps/openmw/mwmechanics/creaturestats.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,6 @@ namespace MWMechanics
155155

156156
void setDynamic(int index, const DynamicStat<float>& value);
157157

158-
/// Set Modifier for each magic effect according to \a effects. Does not touch Base values.
159-
void modifyMagicEffects(const MagicEffects& effects);
160-
161158
void setAttackingOrSpell(bool attackingOrSpell) { mAttackingOrSpell = attackingOrSpell; }
162159

163160
void setAttackType(std::string_view attackType) { mAttackType = attackType; }

apps/openmw/mwmechanics/magiceffects.cpp

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,6 @@ namespace MWMechanics
121121
return *this;
122122
}
123123

124-
void MagicEffects::remove(const EffectKey& key)
125-
{
126-
mCollection.erase(key);
127-
}
128-
129124
void MagicEffects::add(const EffectKey& key, const EffectParam& param)
130125
{
131126
Collection::iterator iter = mCollection.find(key);
@@ -145,19 +140,6 @@ namespace MWMechanics
145140
mCollection[key].modifyBase(diff);
146141
}
147142

148-
void MagicEffects::setModifiers(const MagicEffects& effects)
149-
{
150-
for (Collection::iterator it = mCollection.begin(); it != mCollection.end(); ++it)
151-
{
152-
it->second.setModifier(effects.getOrDefault(it->first).getModifier());
153-
}
154-
155-
for (Collection::const_iterator it = effects.begin(); it != effects.end(); ++it)
156-
{
157-
mCollection[it->first].setModifier(it->second.getModifier());
158-
}
159-
}
160-
161143
EffectParam MagicEffects::getOrDefault(const EffectKey& key) const
162144
{
163145
return get(key).value_or(EffectParam());
@@ -174,40 +156,6 @@ namespace MWMechanics
174156
return std::nullopt;
175157
}
176158

177-
MagicEffects MagicEffects::diff(const MagicEffects& prev, const MagicEffects& now)
178-
{
179-
MagicEffects result;
180-
181-
// adding/changing
182-
for (Collection::const_iterator iter(now.begin()); iter != now.end(); ++iter)
183-
{
184-
Collection::const_iterator other = prev.mCollection.find(iter->first);
185-
186-
if (other == prev.end())
187-
{
188-
// adding
189-
result.add(iter->first, iter->second);
190-
}
191-
else
192-
{
193-
// changing
194-
result.add(iter->first, iter->second - other->second);
195-
}
196-
}
197-
198-
// removing
199-
for (Collection::const_iterator iter(prev.begin()); iter != prev.end(); ++iter)
200-
{
201-
Collection::const_iterator other = now.mCollection.find(iter->first);
202-
if (other == now.end())
203-
{
204-
result.add(iter->first, EffectParam() - iter->second);
205-
}
206-
}
207-
208-
return result;
209-
}
210-
211159
void MagicEffects::writeState(ESM::MagicEffects& state) const
212160
{
213161
for (const auto& [key, params] : mCollection)

apps/openmw/mwmechanics/magiceffects.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,12 @@ namespace MWMechanics
103103
void writeState(ESM::MagicEffects& state) const;
104104

105105
void add(const EffectKey& key, const EffectParam& param);
106-
void remove(const EffectKey& key);
107106

108107
void modifyBase(const EffectKey& key, int diff);
109108

110-
/// Copy Modifier values from \a effects, but keep original mBase values.
111-
void setModifiers(const MagicEffects& effects);
112-
113109
EffectParam getOrDefault(const EffectKey& key) const;
114110
std::optional<EffectParam> get(const EffectKey& key) const;
115111
///< This function can safely be used for keys that are not present.
116-
117-
static MagicEffects diff(const MagicEffects& prev, const MagicEffects& now);
118-
///< Return changes from \a prev to \a now.
119112
};
120113

121114
std::string getMagicEffectString(

0 commit comments

Comments
 (0)