diff options
author | Mattes D <github@xoft.cz> | 2014-06-06 22:31:16 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-06-08 21:58:29 +0200 |
commit | b904223b9dbbe7b696dbd30e748bc131742e11ea (patch) | |
tree | d742f036732e34a4c11f72f906c6f90c7d6ba231 /src/Entities | |
parent | Small change for easier understanding. (diff) | |
download | cuberite-b904223b9dbbe7b696dbd30e748bc131742e11ea.tar cuberite-b904223b9dbbe7b696dbd30e748bc131742e11ea.tar.gz cuberite-b904223b9dbbe7b696dbd30e748bc131742e11ea.tar.bz2 cuberite-b904223b9dbbe7b696dbd30e748bc131742e11ea.tar.lz cuberite-b904223b9dbbe7b696dbd30e748bc131742e11ea.tar.xz cuberite-b904223b9dbbe7b696dbd30e748bc131742e11ea.tar.zst cuberite-b904223b9dbbe7b696dbd30e748bc131742e11ea.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Entities/Entity.h | 5 | ||||
-rw-r--r-- | src/Entities/Player.cpp | 2 | ||||
-rw-r--r-- | src/Entities/Player.h | 2 |
3 files changed, 5 insertions, 4 deletions
diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h index 0c393c0f5..9fe771120 100644 --- a/src/Entities/Entity.h +++ b/src/Entities/Entity.h @@ -421,6 +421,9 @@ public: UNUSED(a_Killer); } + /** Sets the internal world pointer to a new cWorld, doesn't update anything else. */ + void SetWorld(cWorld * a_World) { m_World = a_World; } + protected: static cCriticalSection m_CSCount; static int m_EntityCount; @@ -485,8 +488,6 @@ protected: virtual void Destroyed(void) {} // Called after the entity has been destroyed - void SetWorld(cWorld * a_World) { m_World = a_World; } - /** Called in each tick to handle air-related processing i.e. drowning */ virtual void HandleAir(); diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 3a9324d09..b83419903 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -1595,8 +1595,6 @@ bool cPlayer::MoveToWorld(const char * a_WorldName) m_ClientHandle->MoveToWorld(*World, (OldDimension != World->GetDimension())); // Add player to all the necessary parts of the new world - SetWorld(World); - m_ClientHandle->StreamChunks(); World->AddEntity(this); World->AddPlayer(this); diff --git a/src/Entities/Player.h b/src/Entities/Player.h index b7cb27d6c..83b9ad593 100644 --- a/src/Entities/Player.h +++ b/src/Entities/Player.h @@ -328,6 +328,8 @@ public: void SetVisible( bool a_bVisible ); // tolua_export bool IsVisible(void) const { return m_bVisible; } // tolua_export + /** Moves the player to the specified world. + Returns true if successful, false on failure (world not found). */ bool MoveToWorld(const char * a_WorldName); // tolua_export bool SaveToDisk(void); |