diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-04-27 00:50:24 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-04-27 00:50:24 +0200 |
commit | b4b3b5ce6480419bb18bafa6650dd09ea5544441 (patch) | |
tree | 78a726328b527dcfd3ba2f619465547e214cb8c5 | |
parent | Implemented suggestions (diff) | |
download | cuberite-b4b3b5ce6480419bb18bafa6650dd09ea5544441.tar cuberite-b4b3b5ce6480419bb18bafa6650dd09ea5544441.tar.gz cuberite-b4b3b5ce6480419bb18bafa6650dd09ea5544441.tar.bz2 cuberite-b4b3b5ce6480419bb18bafa6650dd09ea5544441.tar.lz cuberite-b4b3b5ce6480419bb18bafa6650dd09ea5544441.tar.xz cuberite-b4b3b5ce6480419bb18bafa6650dd09ea5544441.tar.zst cuberite-b4b3b5ce6480419bb18bafa6650dd09ea5544441.zip |
-rw-r--r-- | src/Entities/Entity.cpp | 2 | ||||
-rw-r--r-- | src/Entities/Entity.h | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index f535faac7..921457b2d 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -1145,7 +1145,7 @@ void cEntity::BroadcastMovementUpdate(const cClientHandle * a_Exclude) int DiffY = (int)(floor(GetPosY() * 32.0) - floor(m_LastPos.y * 32.0)); int DiffZ = (int)(floor(GetPosZ() * 32.0) - floor(m_LastPos.z * 32.0)); - if ((abs(DiffX) >= 4) || (abs(DiffY) >= 4) || (abs(DiffZ) >= 4)) + if ((abs(DiffX) != 0) || (abs(DiffY) != 0) || (abs(DiffZ) != 0)) // Have we moved? { if ((abs(DiffX) <= 127) && (abs(DiffY) <= 127) && (abs(DiffZ) <= 127)) // Limitations of a Byte { diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h index 0785b5609..22b133fb7 100644 --- a/src/Entities/Entity.h +++ b/src/Entities/Entity.h @@ -419,19 +419,26 @@ protected: /// The entity which is attached to this entity (rider), NULL if none cEntity * m_Attachee; - // Flags that signal that we haven't updated the clients with the latest. + /** Stores whether head yaw has been set manually */ bool m_bDirtyHead; + /** Stores whether our yaw/pitch/roll (body orientation) has been set manually */ bool m_bDirtyOrientation; + /** Stores whether we have sent a Velocity packet with a speed of zero (no speed) to the client + Ensures that said packet is sent only once */ bool m_bHasSentNoSpeed; + /** Stores if the entity is on the ground */ bool m_bOnGround; + /** Stores gravity that is applied to an entity every tick + For realistic effects, this should be negative. For spaaaaaaace, this can be zero or even positive */ float m_Gravity; /** Last position sent to client via the Relative Move or Teleport packets (not Velocity) Only updated if cEntity::BroadcastMovementUpdate() is called! */ Vector3d m_LastPos; - bool m_IsInitialized; // Is set to true when it's initialized, until it's destroyed (Initialize() till Destroy() ) + /** True when entity is initialised (Initialize()) and false when destroyed pending deletion (Destroy()) */ + bool m_IsInitialized; eEntityType m_EntityType; |