Skip to content
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,29 @@ struct npc_corporal_keeshan_escortAI : npc_escortAI
m_uiShieldBashTimer = 8000;
}

void JustRespawned() override
{
// Reset EscortAI
npc_escortAI::JustRespawned();
Reset();
float m_homeX, m_homeY, m_homeZ, m_homeO;

//Reset Faction and Quest Giver Flag
m_creature->SetFactionTemplateId(FACTION_STORMWIND);
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);

// SetSpawn
if (m_homeX || m_homeY || m_homeZ)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m_homeX etc are never set - this if statement is unpredictable.

In debug the variables will be initialized to 0. But on release build the values will be uninitialized.

the m_ prefix should be used for member variables only.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, thanks!

{
m_creature->NearTeleportTo(m_homeX, m_homeY, m_homeZ, m_homeO);
m_creature->SetHomePosition(m_homeX, m_homeY, m_homeZ, m_homeO);
}

// Clear Movement
m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MoveTargetedHome();
}

void WaypointStart(uint32 uiWP) override
{
switch (uiWP)
Expand Down