Core/Objects: Encapsulated Postion::m_orientation field to ensure it is always normalized to 0-2pi range

Closes #7400.
This commit is contained in:
teyrnon
2012-08-20 10:44:14 +02:00
committed by Shauren
parent 69cfc0f7bf
commit 6cea446f22
14 changed files with 46 additions and 52 deletions

View File

@@ -303,7 +303,6 @@ class npc_coldflame : public CreatureScript
{
Position const* ownerPos = marrowgarAI->GetLastColdflamePosition();
float ang = me->GetAngle(ownerPos) - static_cast<float>(M_PI);
ang = MapManager::NormalizeOrientation(ang);
me->SetOrientation(ang);
owner->GetNearPosition(pos, 2.5f, 0.0f);
}

View File

@@ -121,7 +121,7 @@ public:
coreEnergizeOrientation = me->GetOrientation();
firstCoreEnergize = true;
} else
coreEnergizeOrientation = MapManager::NormalizeOrientation(coreEnergizeOrientation - 2.0f);
coreEnergizeOrientation = Position::NormalizeOrientation(coreEnergizeOrientation - 2.0f);
DoCast(me, SPELL_ENERGIZE_CORES_VISUAL);
events.ScheduleEvent(EVENT_ENERGIZE_CORES_VISUAL, 5000);

View File

@@ -488,7 +488,7 @@ class spell_ulduar_squeezed_lifeless : public SpellScriptLoader
pos.m_positionX = 1756.25f + irand(-3, 3);
pos.m_positionY = -8.3f + irand(-3, 3);
pos.m_positionZ = 448.8f;
pos.m_orientation = M_PI;
pos.SetOrientation(M_PI);
GetHitPlayer()->DestroyForNearbyPlayers();
GetHitPlayer()->ExitVehicle(&pos);
GetHitPlayer()->UpdateObjectVisibility(false);