mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[11810] Fix a bug preventing displaying correct instance reset time
Also do some small style changes in the area Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
parent
d55e1b3edb
commit
7279c16533
2 changed files with 32 additions and 31 deletions
|
|
@ -385,8 +385,10 @@ void DungeonResetScheduler::LoadResetTimes()
|
|||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
uint32 instance = fields[1].GetUInt32();
|
||||
|
||||
time_t resettime = time_t(fields[0].GetUInt64() + 2 * HOUR);
|
||||
uint32 instance = fields[1].GetUInt32();
|
||||
|
||||
InstResetTimeMapDiffType::iterator itr = instResetTime.find(instance);
|
||||
if(itr != instResetTime.end() && itr->second.second != resettime)
|
||||
{
|
||||
|
|
@ -412,6 +414,7 @@ void DungeonResetScheduler::LoadResetTimes()
|
|||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 mapid = fields[0].GetUInt32();
|
||||
Difficulty difficulty = Difficulty(fields[1].GetUInt32());
|
||||
uint64 oldresettime = fields[2].GetUInt64();
|
||||
|
|
@ -619,7 +622,7 @@ MapPersistentState* MapPersistentStateManager::AddPersistentState(MapEntry const
|
|||
MapPersistentState *state;
|
||||
if (mapEntry->IsDungeon())
|
||||
{
|
||||
DungeonPersistentState* dungeonState = new DungeonPersistentState(mapEntry->MapID, instanceId, difficulty, completedEncountersMask, resetTime, canReset);
|
||||
DungeonPersistentState* dungeonState = new DungeonPersistentState(mapEntry->MapID, instanceId, difficulty, resetTime, canReset, completedEncountersMask);
|
||||
if (!load)
|
||||
dungeonState->SaveToDB();
|
||||
state = dungeonState;
|
||||
|
|
@ -941,6 +944,7 @@ void MapPersistentStateManager::LoadCreatureRespawnTimes()
|
|||
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3 4 5 6
|
||||
QueryResult *result = CharacterDatabase.Query("SELECT guid, respawntime, map, instance, difficulty, resettime, encountersMask FROM creature_respawn LEFT JOIN instance ON instance = id");
|
||||
if (!result)
|
||||
{
|
||||
|
|
@ -965,9 +969,7 @@ void MapPersistentStateManager::LoadCreatureRespawnTimes()
|
|||
uint32 mapId = fields[2].GetUInt32();
|
||||
uint32 instanceId = fields[3].GetUInt32();
|
||||
uint8 difficulty = fields[4].GetUInt8();
|
||||
|
||||
time_t resetTime = (time_t)fields[5].GetUInt64();
|
||||
|
||||
uint32 completedEncounters = fields[6].GetUInt32();
|
||||
|
||||
CreatureData const* data = sObjectMgr.GetCreatureData(loguid);
|
||||
|
|
@ -1007,6 +1009,7 @@ void MapPersistentStateManager::LoadGameobjectRespawnTimes()
|
|||
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3 4 5 6
|
||||
QueryResult *result = CharacterDatabase.Query("SELECT guid, respawntime, map, instance, difficulty, resettime, encountersMask FROM gameobject_respawn LEFT JOIN instance ON instance = id");
|
||||
|
||||
if (!result)
|
||||
|
|
@ -1032,9 +1035,7 @@ void MapPersistentStateManager::LoadGameobjectRespawnTimes()
|
|||
uint32 mapId = fields[2].GetUInt32();
|
||||
uint32 instanceId = fields[3].GetUInt32();
|
||||
uint8 difficulty = fields[4].GetUInt8();
|
||||
|
||||
time_t resetTime = (time_t)fields[5].GetUInt64();
|
||||
|
||||
uint32 completedEncounters = fields[6].GetUInt32();
|
||||
|
||||
GameObjectData const* data = sObjectMgr.GetGOData(loguid);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "11809"
|
||||
#define REVISION_NR "11810"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue