From 787382caf8d3f7f8df4598b29586b44b7b071c53 Mon Sep 17 00:00:00 2001 From: faketruth Date: Wed, 7 Mar 2012 13:36:30 +0000 Subject: Fixed bug where cPlayer's cClientHandle was used after cPlayer was destroyed http://forum.mc-server.org/showthread.php?tid=380 Also removed the SetClientHandle() function from cPlayer Added a Destroyed() function to cEntity that is called ONLY ONCE after an entity has been 'destroyed' Cleaned up some code, using enums for GameMode and Weather and replaced some 'const char *' with 'const AString &' Exposed some more functions to Lua git-svn-id: http://mc-server.googlecode.com/svn/trunk@382 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cEntity.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/cEntity.h') diff --git a/source/cEntity.h b/source/cEntity.h index 0165276b6..58c0b69f4 100644 --- a/source/cEntity.h +++ b/source/cEntity.h @@ -87,15 +87,15 @@ public: //tolua_export void SetPosX( const double & a_PosX ); //tolua_export void SetPosY( const double & a_PosY ); //tolua_export void SetPosZ( const double & a_PosZ ); //tolua_export - void SetPosition( const double & a_PosX, const double & a_PosY, const double & a_PosZ ); //tolua_export + void SetPosition( const double & a_PosX, const double & a_PosY, const double & a_PosZ );//tolua_export void SetPosition( const Vector3d & a_Pos ); //tolua_export void SetRot( const Vector3f & a_Rot ); //tolua_export void SetRotation( float a_Rotation ); //tolua_export void SetPitch( float a_Pitch ); //tolua_export void SetRoll( float a_Roll ); //tolua_export - inline int GetUniqueID(void) const { return m_UniqueID; } //tolua_export - inline bool IsDestroyed(void) const { return m_bDestroyed; } //tolua_export + inline int GetUniqueID(void) const { return m_UniqueID; } //tolua_export + inline bool IsDestroyed(void) const { return m_bDestroyed; } //tolua_export void Destroy(); //tolua_export void RemoveFromChunk(void); // for internal use in cChunk @@ -108,6 +108,7 @@ public: //tolua_export void WrapRotation(); protected: + virtual void Destroyed() {} // Called after the entity has been destroyed void SetWorld( cWorld* a_World ) { m_World = a_World; } void MoveToCorrectChunk(bool a_bIgnoreOldChunk = false); -- cgit v1.2.3