[10697] Less strict check for update at war state for factions

Clarify in comments of recent added spell dummy effect

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2010-11-08 01:15:46 +01:00
parent 9508001213
commit b4a48f976e
3 changed files with 14 additions and 19 deletions

View file

@ -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

View file

@ -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;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10696"
#define REVISION_NR "10697"
#endif // __REVISION_NR_H__