Core/GameObject: regenerate GO loot if respawn time passed since last loot generation time and not all items were taken (#19101)
This commit is contained in:
1 parent
9d021fce21
commit
206fddf129
3 files changed
+10
No files matched your search
@@ -8580,6 +8580,11 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type)
|
||||
|
||||
loot = &go->loot;
|
||||
|
||||
// loot was generated and respawntime has passed since then, allow to recreate loot
|
||||
// to avoid bugs, this rule covers spawned gameobjects only
|
||||
if (go->isSpawnedByDefault() && go->getLootState() == GO_ACTIVATED && !go->loot.isLooted() && go->GetLootGenerationTime() + go->GetRespawnDelay() < time(nullptr))
|
||||
go->SetLootState(GO_READY);
|
||||
|
||||
if (go->getLootState() == GO_READY)
|
||||
{
|
||||
uint32 lootid = go->GetGOInfo()->GetLootId();
|
||||
@@ -8602,6 +8607,7 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type)
|
||||
group->UpdateLooterGuid(go, true);
|
||||
|
||||
loot->FillLoot(lootid, LootTemplates_Gameobject, this, !groupRules, false, go->GetLootMode());
|
||||
go->SetLootGenerationTime();
|
||||
|
||||
// get next RR player (for next loot)
|
||||
if (groupRules && !go->loot.empty())
|
||||
|
||||
Reference in new issue
Block a user