[7487] Avoid attempt use InstanceSave data for non-dungeons. Author: VladimirMangos

Also check map existance and correctness at instance data loading.
    Removed unused and totally bugged InstanceMap::GetResetTime.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-03-18 20:41:49 -06:00
parent 1c87752584
commit ef47783882
5 changed files with 85 additions and 73 deletions
+8
View File
@@ -15842,6 +15842,14 @@ void Player::_LoadBoundInstances(QueryResult *result)
// so the value read from the DB may be wrong here but only if the InstanceSave is loaded
// and in that case it is not used
MapEntry const* mapEntry = sMapStore.LookupEntry(mapId);
if(!mapEntry || !mapEntry->IsDungeon())
{
sLog.outError("_LoadBoundInstances: player %s(%d) has bind to not existed or not dungeon map %d", GetName(), GetGUIDLow(), mapId);
CharacterDatabase.PExecute("DELETE FROM character_instance WHERE guid = '%d' AND instance = '%d'", GetGUIDLow(), instanceId);
continue;
}
if(!perm && group)
{
sLog.outError("_LoadBoundInstances: player %s(%d) is in group %d but has a non-permanent character bind to map %d,%d,%d", GetName(), GetGUIDLow(), GUID_LOPART(group->GetLeaderGUID()), mapId, instanceId, difficulty);