diff options
author | Shauren <shauren.trinity@gmail.com> | 2020-06-15 00:26:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-15 00:26:08 +0200 |
commit | c715e635cf3feb50ac61d30659e614aaa2cc0c63 (patch) | |
tree | 5af30c80f8b1df3f60852adde4680951f6f55442 /src/server/game/Groups/GroupMgr.cpp | |
parent | abff505a6eaf3e649be506c802b80eed3dd35f3a (diff) | |
parent | cf88f0a9735f9ba010a4ae46e848c8f1a86e17fa (diff) |
Merge pull request #24554 from funjoker/cherry-picks
Diffstat (limited to 'src/server/game/Groups/GroupMgr.cpp')
-rw-r--r-- | src/server/game/Groups/GroupMgr.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/server/game/Groups/GroupMgr.cpp b/src/server/game/Groups/GroupMgr.cpp index 314c74c1766..53d8fb5a877 100644 --- a/src/server/game/Groups/GroupMgr.cpp +++ b/src/server/game/Groups/GroupMgr.cpp @@ -203,10 +203,13 @@ void GroupMgr::LoadGroups() TC_LOG_INFO("server.loading", "Loading Group instance saves..."); { uint32 oldMSTime = getMSTime(); - // 0 1 2 3 4 5 6 7 - QueryResult result = CharacterDatabase.Query("SELECT gi.guid, i.map, gi.instance, gi.permanent, i.difficulty, i.resettime, i.entranceId, COUNT(g.guid) " - "FROM group_instance gi INNER JOIN instance i ON gi.instance = i.id " - "LEFT JOIN character_instance ci LEFT JOIN `groups` g ON g.leaderGuid = ci.guid ON ci.instance = gi.instance AND ci.permanent = 1 GROUP BY gi.instance ORDER BY gi.guid"); + + // 0 1 2 3 4 5 6 + QueryResult result = CharacterDatabase.Query("SELECT gi.guid, i.map, gi.instance, gi.permanent, i.difficulty, i.resettime, i.entranceId, " + // 7 + "(SELECT COUNT(1) FROM character_instance ci LEFT JOIN groups g ON ci.guid = g.leaderGuid WHERE ci.instance = gi.instance AND ci.permanent = 1 LIMIT 1) " + "FROM group_instance gi LEFT JOIN instance i ON gi.instance = i.id ORDER BY guid"); + if (!result) { TC_LOG_INFO("server.loading", ">> Loaded 0 group-instance saves. DB table `group_instance` is empty!"); @@ -232,7 +235,7 @@ void GroupMgr::LoadGroups() if (!difficultyEntry || difficultyEntry->InstanceType != mapEntry->InstanceType) continue; - InstanceSave* save = sInstanceSaveMgr->AddInstanceSave(mapEntry->ID, fields[2].GetUInt32(), Difficulty(diff), time_t(fields[5].GetUInt32()), fields[6].GetUInt32(), fields[7].GetUInt64() != 0, true); + InstanceSave* save = sInstanceSaveMgr->AddInstanceSave(mapEntry->ID, fields[2].GetUInt32(), Difficulty(diff), time_t(fields[5].GetUInt32()), fields[6].GetUInt32(), fields[7].GetUInt64() == 0, true); group->BindToInstance(save, fields[3].GetBool(), true); ++count; } |