Skip to content

Commit

Permalink
[Fix] Binary Resistance: Code Style. Update Type * var is changed to …
Browse files Browse the repository at this point in the history
…Type* var
  • Loading branch information
Retriman committed Jan 31, 2012
1 parent 23ad608 commit 03704e2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/server/game/Entities/Unit/Unit.cpp
Expand Up @@ -902,7 +902,7 @@ uint32 Unit::SpellNonMeleeDamageLog(Unit* victim, uint32 spellID, uint32 damage)
return damageInfo.damage;
}

void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType, bool crit, int32 calc_resist)
void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType, bool crit, int32 calc_resist)
{
if (damage < 0)
return;
Expand Down Expand Up @@ -1495,7 +1495,7 @@ uint32 Unit::GetSpellPenetration(SpellSchoolMask schoolMask) const
return uint32(std::max<int32>(spellPenetration, 0));
}

uint32 Unit::CalcSpellResistance(Unit * victim, SpellSchoolMask schoolMask, bool binary, SpellInfo const * spellProto) const
uint32 Unit::CalcSpellResistance(Unit* victim, SpellSchoolMask schoolMask, bool binary, SpellInfo const* spellProto) const
{
// Magic damage, check for resists
if (uint32(schoolMask & (SPELL_SCHOOL_MASK_NORMAL | SPELL_SCHOOL_HOLY)) > 0)
Expand Down Expand Up @@ -1579,7 +1579,7 @@ uint32 Unit::CalcSpellResistance(Unit * victim, SpellSchoolMask schoolMask, bool
return (resistance * 10);
}

void Unit::CalcAbsorbResist(Unit * victim, SpellSchoolMask schoolMask, DamageEffectType damagetype, uint32 const damage, uint32 * absorb, uint32 * resist, SpellInfo const* spellInfo, int32 calc_resist)
void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffectType damagetype, uint32 const damage, uint32* absorb, uint32* resist, SpellInfo const* spellInfo, int32 calc_resist)
{
if (!victim || !victim->isAlive() || !damage)
return;
Expand Down Expand Up @@ -2407,7 +2407,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spell)
return SPELL_MISS_NONE;
}

uint32 Unit::CalcMagicSpellHitChance(Unit * victim, SpellSchoolMask schoolMask, SpellInfo const * spellProto)
uint32 Unit::CalcMagicSpellHitChance(Unit* victim, SpellSchoolMask schoolMask, SpellInfo const* spellProto)

This comment has been minimized.

Copy link
@FilipLukac

FilipLukac Jan 31, 2012

spellInfo

{
// PvP - PvE spell misschances per leveldif > 2
int32 lchance = victim->GetTypeId() == TYPEID_PLAYER ? 7 : 11;
Expand Down Expand Up @@ -2497,7 +2497,7 @@ uint32 Unit::CalcMagicSpellHitChance(Unit * victim, SpellSchoolMask schoolMask,
return uint32(hit);
}

SpellMissInfo Unit::MagicSpellHitResult(Unit * victim, SpellInfo const * spell)
SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spell)
{
// Can`t miss on dead target (on skinning for example)
if (!victim->isAlive() && victim->GetTypeId() != TYPEID_PLAYER)
Expand Down
12 changes: 6 additions & 6 deletions src/server/game/Entities/Unit/Unit.h
Expand Up @@ -1436,7 +1436,7 @@ class Unit : public WorldObject
void DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss);
void HandleProcExtraAttackFor(Unit* victim);

void CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType = BASE_ATTACK, bool crit = false, int32 calc_resist = -1);
void CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType = BASE_ATTACK, bool crit = false, int32 calc_resist = -1);
void DealSpellDamage(SpellNonMeleeDamage* damageInfo, bool durabilityLoss);

// player or player's pet resilience (-1%)
Expand All @@ -1459,15 +1459,15 @@ class Unit : public WorldObject
float MeleeSpellMissChance(const Unit* pVictim, WeaponAttackType attType, int32 skillDiff, uint32 spellId) const;
SpellMissInfo MeleeSpellHitResult(Unit* pVictim, SpellInfo const* spell);
SpellMissInfo MagicSpellHitResult(Unit* pVictim, SpellInfo const* spell);
SpellMissInfo SpellHitResult(Unit* pVictim, SpellInfo const* spell, bool canReflect = false);
uint32 CalcMagicSpellHitChance(Unit * pVictim, SpellSchoolMask schoolMask, SpellInfo const * spellProto);
SpellMissInfo SpellHitResult(Unit* victim, SpellInfo const* spell, bool canReflect = false);
uint32 CalcMagicSpellHitChance(Unit* victim, SpellSchoolMask schoolMask, SpellInfo const* spellProto);

float GetUnitDodgeChance() const;
float GetUnitParryChance() const;
float GetUnitBlockChance() const;
float GetUnitMissChance(WeaponAttackType attType) const;
float GetUnitCriticalChance(WeaponAttackType attackType, const Unit* pVictim) const;
int32 GetMechanicResistChance(const SpellInfo *spell) const;
int32 GetMechanicResistChance(const SpellInfo* spell) const;
bool CanUseAttackType(uint8 attacktype) const
{
switch (attacktype)
Expand Down Expand Up @@ -2022,8 +2022,8 @@ class Unit : public WorldObject
// redefined in Creature
static bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const* spellInfo = NULL, uint8 effIndex = MAX_SPELL_EFFECTS);
uint32 CalcArmorReducedDamage(Unit* pVictim, const uint32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType=MAX_ATTACK);
void CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEffectType damagetype, const uint32 damage, uint32 *absorb, uint32 *resist, SpellInfo const *spellInfo = NULL, int32 calc_resist = -1);
uint32 CalcSpellResistance(Unit * pVictim, SpellSchoolMask schoolMask, bool binary, SpellInfo const * spellProto) const;

This comment has been minimized.

Copy link
@FilipLukac

FilipLukac Jan 31, 2012

old codestyle :) Unit* victim :)

void CalcAbsorbResist(Unit* pVictim, SpellSchoolMask schoolMask, DamageEffectType damagetype, const uint32 damage, uint32* absorb, uint32* resist, SpellInfo const* spellInfo = NULL, int32 calc_resist = -1);
uint32 CalcSpellResistance(Unit* pVictim, SpellSchoolMask schoolMask, bool binary, SpellInfo const* spellProto) const;

This comment has been minimized.

Copy link
@FilipLukac

FilipLukac Jan 31, 2012

I think spellInfo there

This comment has been minimized.

Copy link
@Retriman

Retriman Jan 31, 2012

Collaborator

I know it's old, but if you see in the line below. is still used.

void CalcHealAbsorb(Unit* pVictim, const SpellInfo* spellProto, uint32 &healAmount, uint32 &absorb);

void UpdateSpeed(UnitMoveType mtype, bool forced);
Expand Down

0 comments on commit 03704e2

Please sign in to comment.