summaryrefslogtreecommitdiffstats
path: root/src/Entities
diff options
context:
space:
mode:
Diffstat (limited to 'src/Entities')
-rw-r--r--src/Entities/Boat.cpp2
-rw-r--r--src/Entities/Effects.h2
-rw-r--r--src/Entities/Entity.h14
-rw-r--r--src/Entities/ExpOrb.h2
-rw-r--r--src/Entities/Floater.h2
-rw-r--r--src/Entities/Player.cpp1
-rw-r--r--src/Entities/ProjectileEntity.cpp12
7 files changed, 22 insertions, 13 deletions
diff --git a/src/Entities/Boat.cpp b/src/Entities/Boat.cpp
index 94b24c5af..921252253 100644
--- a/src/Entities/Boat.cpp
+++ b/src/Entities/Boat.cpp
@@ -122,5 +122,3 @@ void cBoat::HandleSpeedFromAttachee(float a_Forward, float a_Sideways)
AddSpeed(ToAddSpeed);
}
-
- \ No newline at end of file
diff --git a/src/Entities/Effects.h b/src/Entities/Effects.h
index e7611847d..baf3302fb 100644
--- a/src/Entities/Effects.h
+++ b/src/Entities/Effects.h
@@ -27,4 +27,4 @@ enum ENUM_ENTITY_EFFECT
E_EFFECT_ABSORPTION = 22,
E_EFFECT_SATURATION = 23,
} ;
-// tolua_end \ No newline at end of file
+// tolua_end
diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h
index e41f74b09..6e3f8292b 100644
--- a/src/Entities/Entity.h
+++ b/src/Entities/Entity.h
@@ -159,7 +159,7 @@ public:
cWorld * GetWorld(void) const { return m_World; }
- double GetHeadYaw (void) const { return m_HeadYaw; }
+ double GetHeadYaw (void) const { return m_HeadYaw; } // In degrees
double GetHeight (void) const { return m_Height; }
double GetMass (void) const { return m_Mass; }
const Vector3d & GetPosition (void) const { return m_Pos; }
@@ -167,9 +167,9 @@ public:
double GetPosY (void) const { return m_Pos.y; }
double GetPosZ (void) const { return m_Pos.z; }
const Vector3d & GetRot (void) const { return m_Rot; } // OBSOLETE, use individual GetYaw(), GetPitch, GetRoll() components
- double GetYaw (void) const { return m_Rot.x; }
- double GetPitch (void) const { return m_Rot.y; }
- double GetRoll (void) const { return m_Rot.z; }
+ double GetYaw (void) const { return m_Rot.x; } // In degrees, [-180, +180)
+ double GetPitch (void) const { return m_Rot.y; } // In degrees, [-180, +180), but normal client clips to [-90, +90]
+ double GetRoll (void) const { return m_Rot.z; } // In degrees, unused in current client
Vector3d GetLookVector(void) const;
const Vector3d & GetSpeed (void) const { return m_Speed; }
double GetSpeedX (void) const { return m_Speed.x; }
@@ -189,9 +189,9 @@ public:
void SetPosition(double a_PosX, double a_PosY, double a_PosZ);
void SetPosition(const Vector3d & a_Pos) { SetPosition(a_Pos.x, a_Pos.y, a_Pos.z); }
void SetRot (const Vector3f & a_Rot); // OBSOLETE, use individual SetYaw(), SetPitch(), SetRoll() components
- void SetYaw (double a_Yaw);
- void SetPitch (double a_Pitch);
- void SetRoll (double a_Roll);
+ void SetYaw (double a_Yaw); // In degrees, normalizes to [-180, +180)
+ void SetPitch (double a_Pitch); // In degrees, normalizes to [-180, +180)
+ void SetRoll (double a_Roll); // In degrees, normalizes to [-180, +180)
void SetSpeed (double a_SpeedX, double a_SpeedY, double a_SpeedZ);
void SetSpeed (const Vector3d & a_Speed) { SetSpeed(a_Speed.x, a_Speed.y, a_Speed.z); }
void SetSpeedX (double a_SpeedX);
diff --git a/src/Entities/ExpOrb.h b/src/Entities/ExpOrb.h
index c1150bd03..e76274ac9 100644
--- a/src/Entities/ExpOrb.h
+++ b/src/Entities/ExpOrb.h
@@ -42,4 +42,4 @@ protected:
/** The number of ticks that the entity has existed / timer between collect and destroy; in msec */
float m_Timer;
-} ; // tolua_export \ No newline at end of file
+} ; // tolua_export
diff --git a/src/Entities/Floater.h b/src/Entities/Floater.h
index f3b51d77b..547d503f1 100644
--- a/src/Entities/Floater.h
+++ b/src/Entities/Floater.h
@@ -43,4 +43,4 @@ protected:
// Entity IDs
int m_PlayerID;
int m_AttachedMobID;
-} ; // tolua_export \ No newline at end of file
+} ; // tolua_export
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index 863aaa799..646aad50f 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -1489,6 +1489,7 @@ bool cPlayer::MoveToWorld(const char * a_WorldName)
// 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/ProjectileEntity.cpp b/src/Entities/ProjectileEntity.cpp
index f4ab825f2..a9735a53c 100644
--- a/src/Entities/ProjectileEntity.cpp
+++ b/src/Entities/ProjectileEntity.cpp
@@ -4,6 +4,7 @@
// Implements the cProjectileEntity class representing the common base class for projectiles, as well as individual projectile types
#include "Globals.h"
+#include "../Bindings/PluginManager.h"
#include "ProjectileEntity.h"
#include "../ClientHandle.h"
#include "Player.h"
@@ -66,6 +67,11 @@ protected:
eBlockFace Face;
if (bb.CalcLineIntersection(Line1, Line2, LineCoeff, Face))
{
+ if (cPluginManager::Get()->CallHookProjectileHitBlock(*m_Projectile))
+ {
+ return false;
+ }
+
Vector3d Intersection = Line1 + m_Projectile->GetSpeed() * LineCoeff;
m_Projectile->OnHitSolidBlock(Intersection, Face);
return true;
@@ -147,7 +153,11 @@ public:
}
// TODO: Some entities don't interact with the projectiles (pickups, falling blocks)
- // TODO: Allow plugins to interfere about which entities can be hit
+ if (cPluginManager::Get()->CallHookProjectileHitEntity(*m_Projectile, *a_Entity))
+ {
+ // A plugin disagreed.
+ return false;
+ }
if (LineCoeff < m_MinCoeff)
{