Avoid send reset warning to map/difficulty cases without fixedreset time, by VladimirMangos.

--HG--
branch : trunk
This commit is contained in:
n0n4m3
2010-01-16 19:54:57 +03:00
parent 720318e856
commit 147d9dd3dd

View File

@@ -150,13 +150,20 @@ void WorldSession::HandleMoveWorldportAckOpcode()
}
}
if (mInstance && mEntry->IsDungeon())
if (mInstance)
{
Difficulty diff = GetPlayer()->GetDifficulty(mEntry->IsRaid());
if (uint32 timeReset = sInstanceSaveManager.GetResetTimeFor(GetPlayer()->GetMapId(),diff))
if(MapDifficulty const* mapDiff = GetMapDifficultyData(mEntry->MapID,diff))
{
uint32 timeleft = timeReset - time(NULL);
GetPlayer()->SendInstanceResetWarning(GetPlayer()->GetMapId(), diff, timeleft);
if (mapDiff->resetTime)
{
if (uint32 timeReset = sInstanceSaveManager.GetResetTimeFor(mEntry->MapID,diff))
{
uint32 timeleft = timeReset - time(NULL);
GetPlayer()->SendInstanceResetWarning(mEntry->MapID, diff, timeleft);
}
}
}
}