[7124] Removed virtual keyworld from Map::CanUnload method. This method needn't to be virtual. Method moved all into header file to be inlined.

Fixed problem when instance never unloaded in case low population servers where update time always fit into WORLD_SLEEP_CONST and unload time is multiple of this constant.

Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
ApoC 2009-01-20 20:51:08 +01:00
parent ce384c5278
commit 220aa56fed
3 changed files with 8 additions and 10 deletions

View file

@ -1448,14 +1448,6 @@ void Map::RemoveAllObjectsInRemoveList()
//sLog.outDebug("Object remover 2 check."); //sLog.outDebug("Object remover 2 check.");
} }
bool Map::CanUnload(const uint32 &diff)
{
if(!m_unloadTimer) return false;
if(m_unloadTimer < diff) return true;
m_unloadTimer -= diff;
return false;
}
uint32 Map::GetPlayersCountExceptGMs() const uint32 Map::GetPlayersCountExceptGMs() const
{ {
uint32 count = 0; uint32 count = 0;

View file

@ -131,7 +131,13 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
virtual ~Map(); virtual ~Map();
// currently unused for normal maps // currently unused for normal maps
virtual bool CanUnload(const uint32& diff); bool CanUnload(uint32 diff)
{
if(!m_unloadTimer) return false;
if(m_unloadTimer <= diff) return true;
m_unloadTimer -= diff;
return false;
}
virtual bool Add(Player *); virtual bool Add(Player *);
virtual void Remove(Player *, bool); virtual void Remove(Player *, bool);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "7123" #define REVISION_NR "7124"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__