mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-30 05:43:12 +01:00
Core/Creature: temporary summons are now dynamic flagged (oversight in dynspawn). This fixes issues with vehicle kit resets breaking AI.
Closes #20137 #20138 #20153.
(cherry picked from commit 92e9376e5e)
This commit is contained in:
@@ -462,7 +462,11 @@ void Creature::RemoveCorpse(bool setSpawnTime, bool destroyForNearbyPlayers)
|
||||
|
||||
SaveRespawnTime(0, false);
|
||||
}
|
||||
AddObjectToRemoveList();
|
||||
|
||||
if (TempSummon* summon = ToTempSummon())
|
||||
summon->UnSummon();
|
||||
else
|
||||
AddObjectToRemoveList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -669,10 +673,10 @@ void Creature::Update(uint32 diff)
|
||||
{
|
||||
if (IsAIEnabled && m_triggerJustAppeared && m_deathState == ALIVE)
|
||||
{
|
||||
m_triggerJustAppeared = false;
|
||||
AI()->JustAppeared();
|
||||
if (m_respawnCompatibilityMode && m_vehicleKit)
|
||||
m_vehicleKit->Reset();
|
||||
m_triggerJustAppeared = false;
|
||||
AI()->JustAppeared();
|
||||
}
|
||||
|
||||
UpdateMovementFlags();
|
||||
|
||||
@@ -56,6 +56,7 @@ void TempSummon::Update(uint32 diff)
|
||||
switch (m_type)
|
||||
{
|
||||
case TEMPSUMMON_MANUAL_DESPAWN:
|
||||
case TEMPSUMMON_DEAD_DESPAWN:
|
||||
break;
|
||||
case TEMPSUMMON_TIMED_DESPAWN:
|
||||
{
|
||||
@@ -103,7 +104,7 @@ void TempSummon::Update(uint32 diff)
|
||||
case TEMPSUMMON_CORPSE_DESPAWN:
|
||||
{
|
||||
// if m_deathState is DEAD, CORPSE was skipped
|
||||
if (m_deathState == CORPSE || m_deathState == DEAD)
|
||||
if (m_deathState == CORPSE)
|
||||
{
|
||||
UnSummon();
|
||||
return;
|
||||
@@ -111,19 +112,9 @@ void TempSummon::Update(uint32 diff)
|
||||
|
||||
break;
|
||||
}
|
||||
case TEMPSUMMON_DEAD_DESPAWN:
|
||||
{
|
||||
if (m_deathState == DEAD)
|
||||
{
|
||||
UnSummon();
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN:
|
||||
{
|
||||
// if m_deathState is DEAD, CORPSE was skipped
|
||||
if (m_deathState == CORPSE || m_deathState == DEAD)
|
||||
if (m_deathState == CORPSE)
|
||||
{
|
||||
UnSummon();
|
||||
return;
|
||||
@@ -145,13 +136,6 @@ void TempSummon::Update(uint32 diff)
|
||||
}
|
||||
case TEMPSUMMON_TIMED_OR_DEAD_DESPAWN:
|
||||
{
|
||||
// if m_deathState is DEAD, CORPSE was skipped
|
||||
if (m_deathState == DEAD)
|
||||
{
|
||||
UnSummon();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IsInCombat() && IsAlive())
|
||||
{
|
||||
if (m_timer <= diff)
|
||||
|
||||
@@ -1742,7 +1742,7 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
|
||||
break;
|
||||
}
|
||||
|
||||
if (!summon->Create(GenerateLowGuid<HighGuid::Creature>(), this, entry, pos, nullptr, vehId))
|
||||
if (!summon->Create(GenerateLowGuid<HighGuid::Creature>(), this, entry, pos, nullptr, vehId, true))
|
||||
{
|
||||
delete summon;
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user