From b4a48f976e77842a786f622abd9cfd0de28c2c93 Mon Sep 17 00:00:00 2001 From: NoFantasy Date: Mon, 8 Nov 2010 01:15:46 +0100 Subject: [PATCH] [10697] Less strict check for update at war state for factions Clarify in comments of recent added spell dummy effect Signed-off-by: NoFantasy --- src/game/ReputationMgr.cpp | 4 ++-- src/game/SpellEffects.cpp | 27 +++++++++++---------------- src/shared/revision_nr.h | 2 +- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/game/ReputationMgr.cpp b/src/game/ReputationMgr.cpp index e41a929e0..18b85e82c 100644 --- a/src/game/ReputationMgr.cpp +++ b/src/game/ReputationMgr.cpp @@ -375,8 +375,8 @@ void ReputationMgr::SetAtWar( RepListID repListID, bool on ) void ReputationMgr::SetAtWar(FactionState* faction, bool atWar) { - // not allow declare war to own faction - if(atWar && (faction->Flags & FACTION_FLAG_PEACE_FORCED) ) + // not allow declare war to faction unless already hated or less + if (atWar && (faction->Flags & FACTION_FLAG_PEACE_FORCED) && ReputationToRank(faction->Standing) > REP_HATED) return; // already set diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 8e1480aef..f9b20419b 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -1700,27 +1700,22 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) if (m_caster->GetTypeId() != TYPEID_PLAYER) return; - switch(eff_idx) + if (eff_idx == EFFECT_INDEX_0) { - case EFFECT_INDEX_0: - { - Player* pPlayer = (Player*)m_caster; + Player* pPlayer = (Player*)m_caster; - uint32 faction_id = m_currentBasePoints[eff_idx]; - int32 rep_change = m_currentBasePoints[EFFECT_INDEX_1]; + uint32 faction_id = m_currentBasePoints[eff_idx]; + int32 rep_change = m_currentBasePoints[EFFECT_INDEX_1]; - FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction_id); + FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction_id); - if (!factionEntry) - return; + if (!factionEntry) + return; - // set rep to baserep + basepoints (expecting spillover for oposite faction -> become hated) - pPlayer->GetReputationMgr().SetReputation(factionEntry, rep_change); - break; - } - case EFFECT_INDEX_2: - // unclear what this effect is for. - break; + // set rep to baserep + basepoints (expecting spillover for oposite faction -> become hated) + pPlayer->GetReputationMgr().SetReputation(factionEntry, rep_change); + + // EFFECT_INDEX_2 most likely update at war state, we already handle this in SetReputation } return; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index f76f07c7e..99b803f28 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10696" + #define REVISION_NR "10697" #endif // __REVISION_NR_H__