Core/Archaeology: fixed loading current branches and initialize some fields to fix restoring artifacts

This commit is contained in:
Ovahlord
2018-06-18 09:50:52 +02:00
parent ebd23dfbcd
commit 4237522a5b
3 changed files with 8 additions and 7 deletions

View File

@@ -78,6 +78,8 @@ void WorldSession::HandleClientCastFlags(WorldPacket& recvPacket, uint8 castFlag
recvPacket >> archData.FragId; // Currency id
recvPacket >> archData.FragCount; // Currency count
break;
default:
break;
}
}

View File

@@ -27,10 +27,10 @@ class Player;
struct ArchData
{
uint32 FragId;
uint32 FragCount;
uint32 KeyId;
uint32 KeyCount;
uint32 FragId = 0;
uint32 FragCount = 0;
uint32 KeyId = 0;
uint32 KeyCount = 0;
};
enum ContinentState

View File

@@ -65,10 +65,9 @@ void Archaeology::LoadCurrentProjectsFromDB()
uint8 branch = fields[0].GetUInt8();
uint16 project = fields[1].GetUInt16();
auto itr = _branches.find(branch);
if (itr != _branches.end())
if (uint16 old_project = _branches[branch].Project)
{
TC_LOG_ERROR("player.skills", "ERROR - Archaeology: Tried to assign project %u to branch %u, which already holds project %u!", project, branch, itr->second.Project);
TC_LOG_ERROR("player.skills", "ERROR - Archaeology: Tried to assign project %u to branch %u, which already holds project %u!", project, branch, old_project);
continue;
}