mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 01:29:07 +00:00
fix(Core/GameObjects): Lockpicking timer on gameobjects should reset … (#9203)
* fix(Core/GameObjects): Lockpicking timer on gameobjects should reset after 10 minutes. Fixes #8936
This commit is contained in:
@@ -430,6 +430,22 @@ void GameObject::Update(uint32 diff)
|
||||
}
|
||||
}
|
||||
|
||||
for (std::unordered_map<ObjectGuid, int32>::iterator itr = m_SkillupList.begin(); itr != m_SkillupList.end();)
|
||||
{
|
||||
if (itr->second > 0)
|
||||
{
|
||||
if (itr->second > static_cast<int32>(diff))
|
||||
{
|
||||
itr->second -= static_cast<int32>(diff);
|
||||
++itr;
|
||||
}
|
||||
else
|
||||
{
|
||||
itr = m_SkillupList.erase(itr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (m_lootState)
|
||||
{
|
||||
case GO_NOT_READY:
|
||||
@@ -2848,3 +2864,22 @@ SpellInfo const* GameObject::GetSpellForLock(Player const* player) const
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void GameObject::AddToSkillupList(ObjectGuid playerGuid)
|
||||
{
|
||||
int32 timer = GetMap()->IsDungeon() ? -1 : 10 * MINUTE * IN_MILLISECONDS;
|
||||
m_SkillupList[playerGuid] = timer;
|
||||
}
|
||||
|
||||
bool GameObject::IsInSkillupList(ObjectGuid playerGuid) const
|
||||
{
|
||||
for (auto const& itr : m_SkillupList)
|
||||
{
|
||||
if (itr.first == playerGuid)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user