From 4c24781a621b3c572a43f24235dbab696dff0b35 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Tue, 3 Sep 2013 10:20:56 +0200 Subject: Added cEntity's gravity to the Lua API. --- source/Entities/Entity.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/Entities/Entity.h') diff --git a/source/Entities/Entity.h b/source/Entities/Entity.h index f407cd2c1..aa5d8fbd2 100644 --- a/source/Entities/Entity.h +++ b/source/Entities/Entity.h @@ -201,6 +201,10 @@ public: /// Makes this entity take the specified damage. The values are packed into a TDI, knockback calculated, then sent through DoTakeDamage() void TakeDamage(eDamageType a_DamageType, cEntity * a_Attacker, int a_RawDamage, int a_FinalDamage, double a_KnockbackAmount); + float GetGravity(void) const { return m_Gravity; } + + void SetGravity(float a_Gravity) { m_Gravity = a_Gravity; } + // tolua_end /// Makes this entity take damage specified in the a_TDI. The TDI is sent through plugins first, then applied -- cgit v1.2.3 From 3f4718154bcce6fd06939fcc0f0b20ea7181be1e Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 7 Sep 2013 17:14:37 +0200 Subject: Arrows have proper yaw and pitch when shot, and stop when they hit a block. --- source/Entities/Entity.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/Entities/Entity.h') diff --git a/source/Entities/Entity.h b/source/Entities/Entity.h index aa5d8fbd2..0e30f230c 100644 --- a/source/Entities/Entity.h +++ b/source/Entities/Entity.h @@ -205,6 +205,12 @@ public: void SetGravity(float a_Gravity) { m_Gravity = a_Gravity; } + /// Sets the rotation to match the speed vector (entity goes "face-forward") + void SetRotationFromSpeed(void); + + /// Sets the pitch to match the speed vector (entity gies "face-forward") + void SetPitchFromSpeed(void); + // tolua_end /// Makes this entity take damage specified in the a_TDI. The TDI is sent through plugins first, then applied -- cgit v1.2.3