mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 19:37:01 +00:00
Fixed instance heroic/raid reset cooldown at switch normal/heroic difficalty.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
131978c529
commit
cac105f83e
1 changed files with 2 additions and 7 deletions
|
|
@ -128,7 +128,7 @@ void InstanceSaveManager::RemoveInstanceSave(uint32 InstanceId)
|
||||||
InstanceSaveHashMap::iterator itr = m_instanceSaveById.find( InstanceId );
|
InstanceSaveHashMap::iterator itr = m_instanceSaveById.find( InstanceId );
|
||||||
if(itr != m_instanceSaveById.end())
|
if(itr != m_instanceSaveById.end())
|
||||||
{
|
{
|
||||||
// save the resettime for normal instances only when they get unloaded
|
// save the resettime for instances only when they get unloaded
|
||||||
if(time_t resettime = itr->second->GetResetTimeForDB())
|
if(time_t resettime = itr->second->GetResetTimeForDB())
|
||||||
CharacterDatabase.PExecute("UPDATE instance SET resettime = '"UI64FMTD"' WHERE id = '%u'", (uint64)resettime, InstanceId);
|
CharacterDatabase.PExecute("UPDATE instance SET resettime = '"UI64FMTD"' WHERE id = '%u'", (uint64)resettime, InstanceId);
|
||||||
delete itr->second;
|
delete itr->second;
|
||||||
|
|
@ -173,12 +173,7 @@ void InstanceSave::SaveToDB()
|
||||||
|
|
||||||
time_t InstanceSave::GetResetTimeForDB()
|
time_t InstanceSave::GetResetTimeForDB()
|
||||||
{
|
{
|
||||||
// only save the reset time for normal instances
|
return GetResetTime();
|
||||||
const MapEntry *entry = sMapStore.LookupEntry(GetMapId());
|
|
||||||
if(!entry || entry->map_type == MAP_RAID || GetDifficulty() == DIFFICULTY_HEROIC)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return GetResetTime();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// to cache or not to cache, that is the question
|
// to cache or not to cache, that is the question
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue