diff --git a/src/game/chars/CCharFight.cpp b/src/game/chars/CCharFight.cpp index 922b07388..38ce622b8 100644 --- a/src/game/chars/CCharFight.cpp +++ b/src/game/chars/CCharFight.cpp @@ -861,7 +861,8 @@ int CChar::OnTakeDamage( int iDmg, CChar * pSrc, DAMAGE_TYPE uType, int iDmgPhys if ( pSpellDef && pSpellDef->GetPrimarySkill(&iSpellSkill) ) iDisturbChance = pSpellDef->m_Interrupt.GetLinear(Skill_GetBase((SKILL_TYPE)iSpellSkill)); - if ( iDisturbChance && fElemental && !pSpellDef->IsSpellType(SPELLFLAG_SCRIPTED) ) //If Protection spell has SPELLFLAG_SCRIPTED don't make this check. + //If COMBAT_ELEMENTAL is enabled, protection spell has SPELLFLAG_SCRIPTED don't make this check. + if ( iDisturbChance && fElemental && !pSpellDef->IsSpellType(SPELLFLAG_SCRIPTED) ) { // Protection spell can cancel the disturb CItem *pProtectionSpell = LayerFind(LAYER_SPELL_Protection); @@ -924,15 +925,10 @@ int CChar::OnTakeDamage( int iDmg, CChar * pSrc, DAMAGE_TYPE uType, int iDmgPhys { if ( GetTopDist3D(pSrc) < 2 ) { - CItem* pReactive = LayerFind(LAYER_SPELL_Reactive); - + CItem* pReactive = LayerFind(LAYER_SPELL_Reactive); if (pReactive) { - int iReactiveDamage = (iDmg * pReactive->m_itSpell.m_PolyStr) / 100; - if (iReactiveDamage < 1) - { - iReactiveDamage = 1; - } + int iReactiveDamage = maximum(1, (iDmg * pReactive->m_itSpell.m_PolyStr) / 100); iDmg -= iReactiveDamage; pSrc->OnTakeDamage(iReactiveDamage, this, (DAMAGE_TYPE)(DAMAGE_FIXED | DAMAGE_REACTIVE), iDmgPhysical, iDmgFire, iDmgCold, iDmgPoison, iDmgEnergy,(SPELL_TYPE)pReactive->m_itSpell.m_spell); diff --git a/src/game/clients/CClient.h b/src/game/clients/CClient.h index 9e15d714d..2262a7273 100644 --- a/src/game/clients/CClient.h +++ b/src/game/clients/CClient.h @@ -848,6 +848,11 @@ class CClient : public CSObjListRec, public CScriptObj, public CChatChanMember, return m_net; } + inline bool operator==(const CClient& other) const + { + return (m_net == other.m_net); + } + public: char m_zLastMessage[SCRIPT_MAX_LINE_LEN]; // last sysmessage char m_zLastObjMessage[SCRIPT_MAX_LINE_LEN]; // last message diff --git a/src/network/CNetState.h b/src/network/CNetState.h index 44627b11d..a076ab6b9 100644 --- a/src/network/CNetState.h +++ b/src/network/CNetState.h @@ -145,6 +145,11 @@ class CNetState void beginTransaction(int priority); // begin a transaction for grouping packets void endTransaction(void); // end transaction + inline bool operator==(const CNetState& other) const + { + return m_id == other.m_id; + } + friend class CNetworkManager; friend class CNetworkThread; friend class CNetworkInput;