Skip to content

Commit

Permalink
Merge TrinityCore 3.3.5 to ElunaTrinityWotlk [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
Rochet2 committed Feb 17, 2025
2 parents 2b7f5a7 + de3ba52 commit 8e87d62
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/server/game/Entities/GameObject/GameObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2566,8 +2566,16 @@ void GameObject::SetLootState(LootState state, Unit* unit)
AI()->OnLootStateChanged(state, unit);

// Start restock timer if the chest is partially looted or not looted at all
if (GetGoType() == GAMEOBJECT_TYPE_CHEST && state == GO_ACTIVATED && GetGOInfo()->chest.chestRestockTime > 0 && m_restockTime == 0)
m_restockTime = GameTime::GetGameTime() + GetGOInfo()->chest.chestRestockTime;
if (GetGoType() == GAMEOBJECT_TYPE_CHEST && state == GO_ACTIVATED)
{
GameObjectTemplate const* goInfo = GetGOInfo();
if (goInfo->chest.chestRestockTime > 0 && m_restockTime == 0)
m_restockTime = GameTime::GetGameTime() + goInfo->chest.chestRestockTime;

// If world chests were opened, despawn them after 5 minutes
if (goInfo->chest.chestRestockTime == 0 && GetMap()->IsWorldMap())
DespawnOrUnsummon(5min);
}

if (GetGoType() == GAMEOBJECT_TYPE_DOOR) // only set collision for doors on SetGoState
return;
Expand Down
5 changes: 5 additions & 0 deletions src/server/game/Maps/Map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4270,6 +4270,11 @@ bool Map::Instanceable() const
return i_mapEntry && i_mapEntry->Instanceable();
}

bool Map::IsWorldMap() const
{
return i_mapEntry && i_mapEntry->IsWorldMap();
}

bool Map::IsDungeon() const
{
return i_mapEntry && i_mapEntry->IsDungeon();
Expand Down
1 change: 1 addition & 0 deletions src/server/game/Maps/Map.h
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ class TC_GAME_API Map : public GridRefManager<NGridType>
MapDifficulty const* GetMapDifficulty() const;

bool Instanceable() const;
bool IsWorldMap() const;
bool IsDungeon() const;
bool IsNonRaidDungeon() const;
bool IsRaid() const;
Expand Down

0 comments on commit 8e87d62

Please sign in to comment.