diff options
author | Nay <dnpd.dd@gmail.com> | 2012-08-18 17:56:09 +0100 |
---|---|---|
committer | Nay <dnpd.dd@gmail.com> | 2012-08-18 17:56:09 +0100 |
commit | c43bba98a3f674d81887ea9751c233e98c58326d (patch) | |
tree | 1d43072de85d8ebe9d3cb731034b7adb809dcfe6 /src | |
parent | 19bafce5b81ca8918da9933546741cd5f9b7b177 (diff) |
Core: Fix build and cleanup whitespace and double semicolon
Diffstat (limited to 'src')
8 files changed, 28 insertions, 22 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 62d5af6a598..40f124812b8 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -21113,18 +21113,21 @@ bool Player::BuyCurrencyFromVendorSlot(uint64 vendorGuid, uint32 vendorSlot, uin for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) { + if (!iece->RequiredCurrency[i]) + continue; + CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(iece->RequiredCurrency[i]); if (!entry) { - SendBuyError(BUY_ERR_CANT_FIND_ITEM, NULL, currency, 0); + SendBuyError(BUY_ERR_CANT_FIND_ITEM, creature, currency, 0); // Find correct error return false; } uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1; - if (iece->RequiredCurrency[i] && HasCurrency(iece->RequiredCurrency[i], (iece->RequiredCurrencyCount[i] * count) / precision)) + if (HasCurrency(iece->RequiredCurrency[i], (iece->RequiredCurrencyCount[i] * count) / precision)) { - SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, NULL, NULL); // error not verified for currencies + SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, NULL, NULL); // Find correct error return false; } } @@ -21233,16 +21236,19 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) { + if (!iece->RequiredCurrency[i]) + continue; + CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(iece->RequiredCurrency[i]); if (!entry) { - SendBuyError(BUY_ERR_CANT_FIND_ITEM, NULL, currency, 0); + SendBuyError(BUY_ERR_CANT_FIND_ITEM, creature, item, 0); return false; } uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1; - if (iece->RequiredCurrency[i] && HasCurrency(iece->RequiredCurrency[i], (iece->RequiredCurrencyCount[i] * count) / precision)) + if (HasCurrency(iece->RequiredCurrency[i], (iece->RequiredCurrencyCount[i] * count) / precision)) { SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, NULL, NULL); // error not verified for currencies return false; diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index f89a0a6b2fe..aa14d11d2f3 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -227,11 +227,11 @@ float Player::GetHealthBonusFromStamina() { // Taken from PaperDollFrame.lua - 4.3.4.15595 gtOCTHpPerStaminaEntry const* hpBase = sGtOCTHpPerStaminaStore.LookupEntry((getClass() - 1) * GT_MAX_LEVEL + getLevel() - 1); - + float stamina = GetStat(STAT_STAMINA); - float baseStam = std::min(20, stamina); + float baseStam = std::min(20.0f, stamina); float moreStam = stamina - baseStam; - + return baseStam + moreStam * hpBase->ratio; } @@ -240,7 +240,7 @@ float Player::GetManaBonusFromIntellect() // Taken from PaperDollFrame.lua - 4.3.4.15595 float intellect = GetStat(STAT_INTELLECT); - float baseInt = std::min(20, intellect); + float baseInt = std::min(20.0f, intellect); float moreInt = intellect - baseInt; return baseInt + (moreInt * 15.0f); @@ -303,12 +303,12 @@ void Player::UpdateAttackPowerAndDamage(bool ranged) { float strengthValue = std::max((GetStat(STAT_STRENGTH) - 10.0f) * entry->APPerStrenth, 0.0f); float agilityValue = std::max((GetStat(STAT_AGILITY) - 10.0f) * entry->APPerAgility, 0.0f); - + SpellShapeshiftFormEntry const* form = sSpellShapeshiftFormStore.LookupEntry(GetShapeshiftForm()); // Directly taken from client, SHAPESHIFT_FLAG_AP_FROM_STRENGTH ? if (form && form->flags1 & 0x20) - agilityValue += std::max((GetStat(STAT_AGILITY) - 10.0f) * entry->APPerStrenth, 0.0f);; - + agilityValue += std::max((GetStat(STAT_AGILITY) - 10.0f) * entry->APPerStrenth, 0.0f); + val2 = strengthValue + agilityValue; } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 3b94508b643..fff1722e9b2 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7219,7 +7219,7 @@ bool Unit::HandleObsModEnergyAuraProc(Unit* victim, uint32 /*damage*/, AuraEffec /* switch (dummySpell->SpellFamilyName) { - + } */ // processed charge only counting case @@ -7262,10 +7262,10 @@ bool Unit::HandleModDamagePctTakenAuraProc(Unit* victim, uint32 /*damage*/, Aura /* switch (dummySpell->SpellFamilyName) { - + } */ - + // processed charge only counting case if (!triggered_spell_id) return true; @@ -9431,7 +9431,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin // Add SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC percent bonus AddPctN(DoneTotalMod, GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC, spellProto->Mechanic)); - + // done scripted mod (take it from owner) Unit* owner = GetOwner() ? GetOwner() : this; AuraEffectList const& mOverrideClassScript= owner->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); @@ -10555,7 +10555,7 @@ uint32 Unit::MeleeDamageBonusDone(Unit* victim, uint32 pdamage, WeaponAttackType // Add SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC percent bonus if (spellProto) AddPctN(DoneTotalMod, GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC, spellProto->Mechanic)); - + // done scripted mod (take it from owner) Unit* owner = GetOwner() ? GetOwner() : this; // AuraEffectList const& mOverrideClassScript = owner->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index a6b63ac37da..120de2199c2 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -279,7 +279,7 @@ void Group::ConvertToGroup() if (m_subGroupsCounts) { delete[] m_subGroupsCounts; - m_subGroupsCounts = NULL;; + m_subGroupsCounts = NULL; } if (!isBGGroup()) diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index 7cf22d196cc..bbe0435946b 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -296,7 +296,7 @@ enum AuraType SPELL_AURA_MECHANIC_DURATION_MOD_NOT_STACK = 234, SPELL_AURA_MOD_DISPEL_RESIST = 235, SPELL_AURA_CONTROL_VEHICLE = 236, - SPELL_AURA_MOD_SPELL_DAMAGE_OF_ATTACK_POWER = 237, + SPELL_AURA_MOD_SPELL_DAMAGE_OF_ATTACK_POWER = 237, SPELL_AURA_MOD_SPELL_HEALING_OF_ATTACK_POWER = 238, SPELL_AURA_MOD_SCALE_2 = 239, SPELL_AURA_MOD_EXPERTISE = 240, diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp index 8dd4f7dad3e..db9bc3581ea 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -139,7 +139,7 @@ public: { m_uiImpaleTimer = urand(8*IN_MILLISECONDS, 10*IN_MILLISECONDS); m_uiStaggeringStompTimer = 15*IN_MILLISECONDS; - m_uiSummonTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS);; + m_uiSummonTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS); if (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL || GetDifficulty() == RAID_DIFFICULTY_25MAN_HEROIC) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp index 7ee67060f97..9a3c8985371 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp @@ -373,7 +373,7 @@ class boss_algalon_the_observer : public CreatureScript case ACTION_INIT_ALGALON: _firstPull = false; me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - break;; + break; } } diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp index 4928ec40abd..8dff17b1c30 100644 --- a/src/server/scripts/Spells/spell_pet.cpp +++ b/src/server/scripts/Spells/spell_pet.cpp @@ -1688,7 +1688,7 @@ public: if (pet->isGuardian()) ((Guardian*)pet)->SetBonusDamage(owner->GetTotalAttackPowerValue(BASE_ATTACK)); - amount += owner->CalculateDamage(BASE_ATTACK, true, true);; + amount += owner->CalculateDamage(BASE_ATTACK, true, true); } } |