summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source/Entity.cpp22
-rw-r--r--source/Entity.h52
-rw-r--r--source/World.h12
-rw-r--r--source/squirrelbindings/SquirrelBindings.cpp2
4 files changed, 45 insertions, 43 deletions
diff --git a/source/Entity.cpp b/source/Entity.cpp
index 9bc0b3ae2..e5e6061e5 100644
--- a/source/Entity.cpp
+++ b/source/Entity.cpp
@@ -22,7 +22,7 @@ cCriticalSection cEntity::m_CSCount;
-cEntity::cEntity(const double & a_X, const double & a_Y, const double & a_Z)
+cEntity::cEntity(double a_X, double a_Y, double a_Z)
: m_UniqueID( 0 )
, m_Referencers( new cReferenceManager( cReferenceManager::RFMNGR_REFERENCERS ) )
, m_References( new cReferenceManager( cReferenceManager::RFMNGR_REFERENCES ) )
@@ -57,9 +57,9 @@ cEntity::~cEntity()
this
);
- if( !m_bDestroyed || !m_bRemovedFromChunk )
+ if (!m_bDestroyed || !m_bRemovedFromChunk)
{
- LOGERROR("ERROR: Entity deallocated without being destroyed %i or unlinked %i", m_bDestroyed, m_bRemovedFromChunk );
+ LOGERROR("ERROR: Entity deallocated without being destroyed %i or unlinked %i", m_bDestroyed, m_bRemovedFromChunk);
ASSERT(!"Entity deallocated without being destroyed or unlinked");
}
delete m_Referencers;
@@ -269,9 +269,9 @@ void cEntity::SetPosition( const Vector3d & a_Pos )
-void cEntity::SetPosition( const double & a_PosX, const double & a_PosY, const double & a_PosZ )
+void cEntity::SetPosition(double a_PosX, double a_PosY, double a_PosZ)
{
- m_Pos.Set( a_PosX, a_PosY, a_PosZ );
+ m_Pos.Set(a_PosX, a_PosY, a_PosZ);
MoveToCorrectChunk();
m_bDirtyPosition = true;
}
@@ -280,7 +280,7 @@ void cEntity::SetPosition( const double & a_PosX, const double & a_PosY, const d
-void cEntity::SetPosX( const double & a_PosX )
+void cEntity::SetPosX(double a_PosX)
{
m_Pos.x = a_PosX;
MoveToCorrectChunk();
@@ -291,7 +291,7 @@ void cEntity::SetPosX( const double & a_PosX )
-void cEntity::SetPosY( const double & a_PosY )
+void cEntity::SetPosY(double a_PosY)
{
m_Pos.y = a_PosY;
MoveToCorrectChunk();
@@ -302,7 +302,7 @@ void cEntity::SetPosY( const double & a_PosY )
-void cEntity::SetPosZ( const double & a_PosZ )
+void cEntity::SetPosZ(double a_PosZ)
{
m_Pos.z = a_PosZ;
MoveToCorrectChunk();
@@ -315,7 +315,7 @@ void cEntity::SetPosZ( const double & a_PosZ )
//////////////////////////////////////////////////////////////////////////
// Reference stuffs
-void cEntity::AddReference( cEntity*& a_EntityPtr )
+void cEntity::AddReference(cEntity * & a_EntityPtr)
{
m_References->AddReference( a_EntityPtr );
a_EntityPtr->ReferencedBy( a_EntityPtr );
@@ -325,7 +325,7 @@ void cEntity::AddReference( cEntity*& a_EntityPtr )
-void cEntity::ReferencedBy( cEntity*& a_EntityPtr )
+void cEntity::ReferencedBy(cEntity * & a_EntityPtr)
{
m_Referencers->AddReference( a_EntityPtr );
}
@@ -334,7 +334,7 @@ void cEntity::ReferencedBy( cEntity*& a_EntityPtr )
-void cEntity::Dereference( cEntity*& a_EntityPtr )
+void cEntity::Dereference(cEntity*& a_EntityPtr)
{
m_Referencers->Dereference( a_EntityPtr );
}
diff --git a/source/Entity.h b/source/Entity.h
index 15c351a09..613032938 100644
--- a/source/Entity.h
+++ b/source/Entity.h
@@ -62,7 +62,7 @@ public:
ENTITY_STATUS_SHEEP_EATING = 10,
} ;
- cEntity(const double & a_X, const double & a_Y, const double & a_Z);
+ cEntity(double a_X, double a_Y, double a_Z);
virtual ~cEntity();
virtual void Initialize(cWorld * a_World);
@@ -77,33 +77,33 @@ public:
virtual unsigned int GetEntityType() { return m_EntityType; }
virtual bool IsA( const char* a_EntityType );
virtual const char* GetClass();
- // tolua_end
- cWorld * GetWorld(void) const { return m_World; } //tolua_export
-
- const Vector3d & GetPosition(void) const {return m_Pos; } //tolua_export
- const double & GetPosX (void) const {return m_Pos.x; } //tolua_export
- const double & GetPosY (void) const {return m_Pos.y; } //tolua_export
- const double & GetPosZ (void) const {return m_Pos.z; } //tolua_export
- const Vector3f & GetRot (void) const {return m_Rot; } //tolua_export
- float GetRotation(void) const {return m_Rot.x; } //tolua_export
- float GetPitch (void) const {return m_Rot.y; } //tolua_export
- float GetRoll (void) const {return m_Rot.z; } //tolua_export
- Vector3f GetLookVector(); //tolua_export
+ cWorld * GetWorld(void) const { return m_World; }
+
+ const Vector3d & GetPosition(void) const {return m_Pos; }
+ double GetPosX (void) const {return m_Pos.x; }
+ double GetPosY (void) const {return m_Pos.y; }
+ double GetPosZ (void) const {return m_Pos.z; }
+ const Vector3f & GetRot (void) const {return m_Rot; }
+ float GetRotation(void) const {return m_Rot.x; }
+ float GetPitch (void) const {return m_Rot.y; }
+ float GetRoll (void) const {return m_Rot.z; }
+ Vector3f GetLookVector(void);
- int GetChunkX(void) const {return m_ChunkX; } //tolua_export
- int GetChunkY(void) const {return m_ChunkY; } //tolua_export
- int GetChunkZ(void) const {return m_ChunkZ; } //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 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
+ int GetChunkX(void) const {return m_ChunkX; }
+ int GetChunkY(void) const {return m_ChunkY; }
+ int GetChunkZ(void) const {return m_ChunkZ; }
+
+ void SetPosX (double a_PosX);
+ void SetPosY (double a_PosY);
+ void SetPosZ (double a_PosZ);
+ void SetPosition(double a_PosX, double a_PosY, double a_PosZ);
+ void SetPosition(const Vector3d & a_Pos);
+ void SetRot (const Vector3f & a_Rot);
+ void SetRotation(float a_Rotation);
+ void SetPitch (float a_Pitch);
+ void SetRoll (float a_Roll);
+ // tolua_end
inline int GetUniqueID(void) const { return m_UniqueID; } //tolua_export
inline bool IsDestroyed(void) const { return m_bDestroyed; } //tolua_export
diff --git a/source/World.h b/source/World.h
index 530370ce5..9609d8b3f 100644
--- a/source/World.h
+++ b/source/World.h
@@ -301,12 +301,14 @@ public:
/// Retrieves block types of the specified blocks. If a chunk is not loaded, doesn't modify the block. Returns true if all blocks were read.
bool GetBlocks(sSetBlockVector & a_Blocks, bool a_ContinueOnFailure);
- bool DigBlock (int a_X, int a_Y, int a_Z); //tolua_export
- void SendBlockTo(int a_X, int a_Y, int a_Z, cPlayer * a_Player ); //tolua_export
+ // tolua_begin
+ bool DigBlock (int a_X, int a_Y, int a_Z);
+ void SendBlockTo(int a_X, int a_Y, int a_Z, cPlayer * a_Player );
- const double & GetSpawnX(void) const { return m_SpawnX; } // tolua_export
- const double & GetSpawnY(void) const { return m_SpawnY; } // tolua_export
- const double & GetSpawnZ(void) const { return m_SpawnZ; } // tolua_export
+ double GetSpawnX(void) const { return m_SpawnX; }
+ double GetSpawnY(void) const { return m_SpawnY; }
+ double GetSpawnZ(void) const { return m_SpawnZ; }
+ // tolua_end
inline cSimulatorManager * GetSimulatorManager(void) { return m_SimulatorManager; }
diff --git a/source/squirrelbindings/SquirrelBindings.cpp b/source/squirrelbindings/SquirrelBindings.cpp
index a463e55d1..876105f19 100644
--- a/source/squirrelbindings/SquirrelBindings.cpp
+++ b/source/squirrelbindings/SquirrelBindings.cpp
@@ -79,7 +79,7 @@ void BindSquirrel(HSQUIRRELVM vm)
.Func("SetPosX", &cEntity::SetPosX)
.Func("SetPosY", &cEntity::SetPosY)
.Func("SetPosZ", &cEntity::SetPosZ)
- .Func<void (cEntity::*) (const double &, const double &, const double &)>("SetPosition", &cEntity::SetPosition)
+ .Func<void (cEntity::*) (double, double, double)>("SetPosition", &cEntity::SetPosition)
.Func("GetUniqueID", &cEntity::GetUniqueID)
.Func("IsDestroyed", &cEntity::IsDestroyed)
.Func("Destroy", &cEntity::Destroy)