mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 23:26:23 +00:00
fix(Core/BattlegroundAV) Irondeep/Coldtooth Supplies never despawning (#8612)
This commit is contained in:
@@ -1610,7 +1610,7 @@ Creature* Battleground::GetBGCreature(uint32 type)
|
||||
return creature;
|
||||
}
|
||||
|
||||
void Battleground::SpawnBGObject(uint32 type, uint32 respawntime)
|
||||
void Battleground::SpawnBGObject(uint32 type, uint32 respawntime, uint32 forceRespawnDelay)
|
||||
{
|
||||
if (Map* map = FindBgMap())
|
||||
if (GameObject* obj = map->GetGameObject(BgObjects[type]))
|
||||
@@ -1622,6 +1622,11 @@ void Battleground::SpawnBGObject(uint32 type, uint32 respawntime)
|
||||
obj->SetLootState(GO_READY);
|
||||
obj->SetRespawnTime(respawntime);
|
||||
map->AddToMap(obj);
|
||||
|
||||
if (forceRespawnDelay)
|
||||
{
|
||||
obj->SetRespawnDelay(forceRespawnDelay);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -567,7 +567,7 @@ public:
|
||||
typedef GuidVector BGCreatures;
|
||||
BGObjects BgObjects;
|
||||
BGCreatures BgCreatures;
|
||||
void SpawnBGObject(uint32 type, uint32 respawntime);
|
||||
void SpawnBGObject(uint32 type, uint32 respawntime, uint32 forceRespawnDelay = 0);
|
||||
bool AddObject(uint32 type, uint32 entry, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime = 0, GOState goState = GO_STATE_READY);
|
||||
Creature* AddCreature(uint32 entry, uint32 type, float x, float y, float z, float o, uint32 respawntime = 0, MotionTransport* transport = nullptr);
|
||||
bool DelCreature(uint32 type);
|
||||
|
||||
@@ -437,9 +437,9 @@ void BattlegroundAV::StartingEventOpenDoors()
|
||||
{
|
||||
LOG_DEBUG("bg.battleground", "BG_AV: start spawning mine stuff");
|
||||
for (uint16 i = BG_AV_OBJECT_MINE_SUPPLY_N_MIN; i <= BG_AV_OBJECT_MINE_SUPPLY_N_MAX; i++)
|
||||
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
|
||||
SpawnBGObject(i, RESPAWN_IMMEDIATELY, 5 * MINUTE);
|
||||
for (uint16 i = BG_AV_OBJECT_MINE_SUPPLY_S_MIN; i <= BG_AV_OBJECT_MINE_SUPPLY_S_MAX; i++)
|
||||
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
|
||||
SpawnBGObject(i, RESPAWN_IMMEDIATELY, 5 * MINUTE);
|
||||
for (uint8 mine = AV_NORTH_MINE; mine <= AV_SOUTH_MINE; mine++) //mine population
|
||||
ChangeMineOwner(mine, TEAM_NEUTRAL, true);
|
||||
|
||||
|
||||
@@ -1194,13 +1194,18 @@ bool GameObject::IsInvisibleDueToDespawn() const
|
||||
void GameObject::SetRespawnTime(int32 respawn)
|
||||
{
|
||||
m_respawnTime = respawn > 0 ? time(nullptr) + respawn : 0;
|
||||
m_respawnDelayTime = respawn > 0 ? respawn : 0;
|
||||
SetRespawnDelay(respawn);
|
||||
if (respawn && !m_spawnedByDefault)
|
||||
{
|
||||
UpdateObjectVisibility(true);
|
||||
}
|
||||
}
|
||||
|
||||
void GameObject::SetRespawnDelay(int32 respawn)
|
||||
{
|
||||
m_respawnDelayTime = respawn > 0 ? respawn : 0;
|
||||
}
|
||||
|
||||
void GameObject::Respawn()
|
||||
{
|
||||
if (m_spawnedByDefault && m_respawnTime > 0)
|
||||
|
||||
@@ -811,6 +811,7 @@ public:
|
||||
}
|
||||
|
||||
void SetRespawnTime(int32 respawn);
|
||||
void SetRespawnDelay(int32 respawn);
|
||||
void Respawn();
|
||||
[[nodiscard]] bool isSpawned() const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user