mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
fix(Core/Creatures): Fixed unitialized varibale implemented in 728d018. (#5042)
- Closes #5030 Co-authored-by: UltraNix <ultranix@gmail.com>
This commit is contained in:
@@ -185,6 +185,8 @@ Creature::Creature(bool isWorldObject): Unit(isWorldObject), MovableMapObject(),
|
||||
TriggerJustRespawned = false;
|
||||
m_isTempWorldObject = false;
|
||||
_focusSpell = nullptr;
|
||||
|
||||
m_respawnedTime = time_t(0);
|
||||
}
|
||||
|
||||
Creature::~Creature()
|
||||
@@ -1790,6 +1792,8 @@ void Creature::Respawn(bool force)
|
||||
|
||||
//Re-initialize reactstate that could be altered by movementgenerators
|
||||
InitializeReactState();
|
||||
|
||||
m_respawnedTime = sWorld->GetGameTime();
|
||||
}
|
||||
m_respawnedTime = time(nullptr);
|
||||
// xinef: relocate notifier, fixes npc appearing in corpse position after forced respawn (instead of spawn)
|
||||
@@ -2277,7 +2281,7 @@ bool Creature::CanCreatureAttack(Unit const* victim, bool skipDistCheck) const
|
||||
return false;
|
||||
|
||||
// cannot attack if is during 5 second grace period, unless being attacked
|
||||
if ((time(nullptr) - m_respawnedTime) < 5 && victim->getAttackers().empty())
|
||||
if (m_respawnedTime && (sWorld->GetGameTime() - m_respawnedTime) < 5 && victim->getAttackers().empty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user