[svn] * Allow WorldObjects to keep the grid active, and prevent it from being unloaded. This can be done through calling WorldObject::setActive(bool) from the scripting library. Note that entire instances are still unloaded if no player is present on that map to save resources. This behavior can be changed if the need arises.

--HG--
branch : trunk
This commit is contained in:
w12x
2008-10-27 08:41:55 -05:00
parent 0e18e4330c
commit e72a13c3dd
13 changed files with 97 additions and 29 deletions
+9 -1
View File
@@ -27,6 +27,7 @@
#include "UpdateData.h"
#include "GameSystem/GridReference.h"
#include "ObjectDefines.h"
#include "GridDefines.h"
#include <set>
#include <string>
@@ -323,7 +324,11 @@ class TRINITY_DLL_SPEC Object
class TRINITY_DLL_SPEC WorldObject : public Object
{
public:
virtual ~WorldObject ( ) {}
virtual ~WorldObject ( );
virtual void AddToWorld();
virtual void RemoveFromWorld();
virtual void Update ( uint32 /*time_diff*/ ) { }
@@ -448,9 +453,12 @@ class TRINITY_DLL_SPEC WorldObject : public Object
Map const* GetBaseMap() const;
Creature* SummonCreature(uint32 id, float x, float y, float z, float ang,TempSummonType spwtype,uint32 despwtime);
GameObject* SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime);
bool isActive() const { return m_isActive; }
virtual void setActive(bool isActive);
protected:
explicit WorldObject();
std::string m_name;
bool m_isActive;
private:
uint32 m_mapId;