Core/Position: Refactor GetAngle -> GetAbsoluteAngle because code clarity is good.

(cherry picked from commit 4692e10ca2)
This commit is contained in:
Treeston
2018-04-01 13:52:36 +02:00
committed by Shauren
parent bf958da148
commit bc89e1cdb0
38 changed files with 71 additions and 89 deletions

View File

@@ -306,7 +306,7 @@ public:
me->UseDoorOrButton();
int Random = rand32() % (sizeof(NpcPrisonEntry) / sizeof(uint32));
if (Creature* creature = player->SummonCreature(NpcPrisonEntry[Random], me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetAngle(player),
if (Creature* creature = player->SummonCreature(NpcPrisonEntry[Random], me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetAbsoluteAngle(player),
TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
{
if (!creature->IsHostileTo(player))
@@ -366,7 +366,7 @@ public:
me->UseDoorOrButton();
int Random = rand32() % (sizeof(NpcStasisEntry) / sizeof(uint32));
player->SummonCreature(NpcStasisEntry[Random], me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetAngle(player),
player->SummonCreature(NpcStasisEntry[Random], me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetAbsoluteAngle(player),
TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
return false;
@@ -1250,8 +1250,8 @@ public:
bool GossipHello(Player* player) override
{
player->SendLoot(me->GetGUID(), LOOT_CORPSE);
me->SummonCreature(NPC_HIVE_AMBUSHER, me->GetPositionX() + 1, me->GetPositionY(), me->GetPositionZ(), me->GetAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
me->SummonCreature(NPC_HIVE_AMBUSHER, me->GetPositionX(), me->GetPositionY() + 1, me->GetPositionZ(), me->GetAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
me->SummonCreature(NPC_HIVE_AMBUSHER, me->GetPositionX() + 1, me->GetPositionY(), me->GetPositionZ(), me->GetAbsoluteAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
me->SummonCreature(NPC_HIVE_AMBUSHER, me->GetPositionX(), me->GetPositionY() + 1, me->GetPositionZ(), me->GetAbsoluteAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
return true;
}
};

View File

@@ -2481,7 +2481,7 @@ class npc_train_wrecker : public CreatureScript
_isSearching = false;
_target = target->GetGUID();
me->SetWalk(true);
me->GetMotionMaster()->MovePoint(MOVEID_CHASE, target->GetNearPosition(3.0f, target->GetAngle(me)));
me->GetMotionMaster()->MovePoint(MOVEID_CHASE, target->GetNearPosition(3.0f, target->GetAbsoluteAngle(me)));
}
else
_timer = 3 * IN_MILLISECONDS;