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

Also check map existance and correctness at instance data loading.
Removed unused and totally bugged InstanceMap::GetResetTime.
This commit is contained in:
VladimirMangos 2009-03-18 15:57:13 +03:00
parent b3490d3b74
commit a7fd57cc74
6 changed files with 85 additions and 70 deletions

View file

@ -15469,6 +15469,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);