aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoschiwald <joschiwald.trinity@gmail.com>2017-01-01 19:51:14 +0100
committerjoschiwald <joschiwald.trinity@gmail.com>2017-01-01 19:51:14 +0100
commitc23dd79dfabdb310c3cd96d0955ab995b7c2e2f7 (patch)
tree59cb0b7d069ccebbb733bf7a984ae90edb82ce41
parent86b98686a95e23247ecb774fb23ecd5b8d94b97b (diff)
Core/Entities: fixed array size
Core/Misc: fixed compile warning
-rw-r--r--src/server/game/Battlefield/Zones/BattlefieldTB.cpp2
-rw-r--r--src/server/game/Entities/Unit/Unit.h2
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp54
3 files changed, 6 insertions, 52 deletions
diff --git a/src/server/game/Battlefield/Zones/BattlefieldTB.cpp b/src/server/game/Battlefield/Zones/BattlefieldTB.cpp
index 43bac5dfa1f..4731bc0eadd 100644
--- a/src/server/game/Battlefield/Zones/BattlefieldTB.cpp
+++ b/src/server/game/Battlefield/Zones/BattlefieldTB.cpp
@@ -483,7 +483,7 @@ void BattlefieldTB::UpdateNPCsAndGameObjects()
door->SetGoState(GetState() == BATTLEFIELD_INACTIVE ? GO_STATE_ACTIVE : GO_STATE_READY);
// Decide which cellblock and questgiver will be active.
- m_iCellblockRandom = GetState() == BATTLEFIELD_INACTIVE ? urand(0, CELLBLOCK_MAX - 1) : CELLBLOCK_NONE;
+ m_iCellblockRandom = GetState() == BATTLEFIELD_INACTIVE ? urand(CELLBLOCK_THE_HOLE, CELLBLOCK_CURSED_DEPTHS) : uint8(CELLBLOCK_NONE);
// To The Hole gate
if (GameObject* door = GetGameObject(m_gateToTheHoleGUID))
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index f926fb83710..be4c60427a1 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -675,7 +675,7 @@ enum CombatRating
CR_UNUSED_12 = 31
};
-#define MAX_COMBAT_RATING 31
+#define MAX_COMBAT_RATING 32
enum DamageEffectType
{
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 2eff3586d9c..96bf92a5cf8 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -1737,57 +1737,13 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo
if (!(mode & AURA_EFFECT_HANDLE_REAL))
return;
+ SpellShapeshiftFormEntry const* shapeInfo = sSpellShapeshiftFormStore.LookupEntry(GetMiscValue());
+ ASSERT(shapeInfo, "Spell %u uses unknown ShapeshiftForm (%u).", GetId(), GetMiscValue());
+
Unit* target = aurApp->GetTarget();
- uint32 modelid = 0;
- Powers PowerType = POWER_MANA;
ShapeshiftForm form = ShapeshiftForm(GetMiscValue());
-
- switch (form)
- {
- case FORM_CAT_FORM:
- case FORM_GHOUL:
- case FORM_TIGER_STANCE:
- case FORM_OX_STANCE:
- PowerType = POWER_ENERGY;
- break;
-
- case FORM_BEAR_FORM:
-
- case FORM_BATTLE_STANCE:
- case FORM_DEFENSIVE_STANCE:
- case FORM_BERSERKER_STANCE:
- PowerType = POWER_RAGE;
- break;
-
- case FORM_TREE_OF_LIFE:
- case FORM_TRAVEL_FORM:
- case FORM_AQUATIC_FORM:
- case FORM_AMBIENT:
-
- case FORM_THARONJA_SKELETON:
- case FORM_DARKMOON_TEST_OF_STRENGTH:
- case FORM_BLB_PLAYER:
- case FORM_SHADOW_DANCE:
- case FORM_CRANE_STANCE:
- case FORM_GHOST_WOLF:
-
- case FORM_SERPENT_STANCE:
- case FORM_ZOMBIE:
- case FORM_METAMORPHOSIS:
- case FORM_UNDEAD:
- case FORM_FLIGHT_FORM_EPIC:
- case FORM_SHADOWFORM:
- case FORM_FLIGHT_FORM:
- case FORM_STEALTH:
- case FORM_MOONKIN_FORM:
- case FORM_SPIRIT_OF_REDEMPTION:
- break;
- default:
- TC_LOG_ERROR("spells", "Auras: Unknown Shapeshift Type: %u", GetMiscValue());
- }
-
- modelid = target->GetModelForForm(form);
+ uint32 modelid = target->GetModelForForm(form);
if (apply)
{
@@ -1919,8 +1875,6 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo
if (target->GetTypeId() == TYPEID_PLAYER)
{
- SpellShapeshiftFormEntry const* shapeInfo = sSpellShapeshiftFormStore.LookupEntry(form);
- ASSERT(shapeInfo);
// Learn spells for shapeshift form - no need to send action bars or add spells to spellbook
for (uint8 i = 0; i < MAX_SHAPESHIFT_SPELLS; ++i)
{