Core/Unit: Standardize SetFacingTo and SetFacingToObject behavior while moving. Both now fail while moving unless arg2 bool is true.

Movement/SplineChain: Bump value range for DB chainId up to uint16 (0 to 65535) from uint8 (0 to 255). Turns out sniffs generate far more chains than I expected.

(cherry picked from commit 2170541a51)

Code style follow-up, I blame Notepad++.
(cherry picked from commit 7860da0de6)
This commit is contained in:
treeston
2016-09-20 20:19:15 +02:00
committed by joschiwald
parent b94642fb49
commit 205ec4c3bf
20 changed files with 41 additions and 31 deletions

View File

@@ -220,7 +220,7 @@ public:
{
case 4:
SetEscortPaused(true);
me->SetFacingTo(1.775791f);
me->SetFacingTo(1.775791f, true);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
Talk(SAY_MORRIDUNE_2);
break;

View File

@@ -246,7 +246,7 @@ public:
me->SetCanFly(true);
me->SetDisableGravity(true);
me->SetByteFlag(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
me->SetFacingTo(me->GetOrientation() + float(M_PI));
me->SetFacingTo(me->GetOrientation() + float(M_PI), true);
if (Creature * trigger = me->SummonCreature(NPC_TRIGGER, MiddleRoomLocation, TEMPSUMMON_CORPSE_DESPAWN))
triggerGUID = trigger->GetGUID();
me->GetMotionMaster()->MoveTakeoff(11, Phase2Floating);

View File

@@ -306,7 +306,7 @@ class boss_devourer_of_souls : public CreatureScript
case EVENT_WAILING_SOULS_TICK:
beamAngle += beamAngleDiff;
me->SetFacingTo(beamAngle);
me->SetFacingTo(beamAngle, true);
me->StopMoving();
DoCast(me, SPELL_WAILING_SOULS);

View File

@@ -361,12 +361,12 @@ class boss_sindragosa : public CreatureScript
break;
case POINT_AIR_PHASE:
me->CastCustomSpell(SPELL_ICE_TOMB_TARGET, SPELLVALUE_MAX_TARGETS, RAID_MODE<int32>(2, 5, 2, 6), NULL, TRIGGERED_FULL_MASK);
me->SetFacingTo(float(M_PI));
me->SetFacingTo(float(M_PI), true);
events.ScheduleEvent(EVENT_AIR_MOVEMENT_FAR, 1);
events.ScheduleEvent(EVENT_FROST_BOMB, 9000);
break;
case POINT_AIR_PHASE_FAR:
me->SetFacingTo(float(M_PI));
me->SetFacingTo(float(M_PI), true);
events.ScheduleEvent(EVENT_LAND, 30000);
break;
case POINT_LAND:
@@ -722,7 +722,7 @@ class npc_spinestalker : public CreatureScript
me->SetDisableGravity(false);
me->RemoveByteFlag(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
me->SetHomePosition(SpinestalkerLandPos);
me->SetFacingTo(SpinestalkerLandPos.GetOrientation());
me->SetFacingTo(SpinestalkerLandPos.GetOrientation(), true);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetReactState(REACT_AGGRESSIVE);
}
@@ -859,7 +859,7 @@ class npc_rimefang : public CreatureScript
me->SetDisableGravity(false);
me->RemoveByteFlag(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
me->SetHomePosition(RimefangLandPos);
me->SetFacingTo(RimefangLandPos.GetOrientation());
me->SetFacingTo(RimefangLandPos.GetOrientation(), true);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetReactState(REACT_AGGRESSIVE);
}

View File

@@ -813,7 +813,7 @@ class boss_the_lich_king : public CreatureScript
events.ScheduleEvent(EVENT_INTRO_TALK_1, 9000, 0, PHASE_INTRO);
break;
case POINT_CENTER_1:
me->SetFacingTo(0.0f);
me->SetFacingTo(0.0f, true);
Talk(SAY_LK_REMORSELESS_WINTER);
me->GetMap()->SetZoneMusic(AREA_THE_FROZEN_THRONE, MUSIC_SPECIAL);
DoCast(me, SPELL_REMORSELESS_WINTER_1);
@@ -828,7 +828,7 @@ class boss_the_lich_king : public CreatureScript
events.ScheduleEvent(EVENT_SOUL_REAPER, 94000, 0, PHASE_TWO);
break;
case POINT_CENTER_2:
me->SetFacingTo(0.0f);
me->SetFacingTo(0.0f, true);
Talk(SAY_LK_REMORSELESS_WINTER);
me->GetMap()->SetZoneMusic(AREA_THE_FROZEN_THRONE, MUSIC_SPECIAL);
DoCast(me, SPELL_REMORSELESS_WINTER_2);

View File

@@ -437,7 +437,7 @@ class boss_algalon_the_observer : public CreatureScript
me->SetDisableGravity(false);
else if (pointId == POINT_ALGALON_OUTRO)
{
me->SetFacingTo(1.605703f);
me->SetFacingTo(1.605703f, true);
events.ScheduleEvent(EVENT_OUTRO_3, 1200);
events.ScheduleEvent(EVENT_OUTRO_4, 2400);
events.ScheduleEvent(EVENT_OUTRO_5, 8500);

View File

@@ -75,7 +75,7 @@ class boss_erekem : public CreatureScript
void MovementInform(uint32 type, uint32 pointId) override
{
if (type == EFFECT_MOTION_TYPE && pointId == POINT_INTRO)
me->SetFacingTo(4.921828f);
me->SetFacingTo(4.921828f, true);
}
void JustReachedHome() override

View File

@@ -430,6 +430,8 @@ class npc_sinclari_vh : public CreatureScript
me->GetCreatureListWithEntryInGrid(guardList, NPC_VIOLET_HOLD_GUARD, 100.0f);
for (Creature* guard : guardList)
{
if (!guard->IsAlive())
continue;
guard->SetReactState(REACT_PASSIVE);
guard->SetWalk(false);
guard->GetMotionMaster()->MovePoint(0, GuardsMovePosition);

View File

@@ -173,7 +173,7 @@ class npc_commander_eligor_dawnbringer : public CreatureScript
{
if (id == 1)
{
me->SetFacingTo(PosTalkLocations[talkWing].GetOrientation());
me->SetFacingTo(PosTalkLocations[talkWing].GetOrientation(), true);
TurnAudience();
switch (talkWing)

View File

@@ -444,7 +444,7 @@ public:
else if (pointId == AKAMA_INTRO_WAYPOINT)
{
me->SetWalk(false);
me->SetFacingTo(0.08726646f);
me->SetFacingTo(0.08726646f, true);
_events.ScheduleEvent(EVENT_START_SOUL_EXPEL, Seconds(1));
}
}

View File

@@ -594,7 +594,7 @@ class boss_kaelthas : public CreatureScript
events.ScheduleEvent(EVENT_TRANSITION_1, 1000);
break;
case POINT_TRANSITION_CENTER_ASCENDING:
me->SetFacingTo(float(M_PI));
me->SetFacingTo(float(M_PI), true);
Talk(SAY_PHASE5_NUTS);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetDisableGravity(true);