summaryrefslogtreecommitdiffstats
path: root/source/Entities/ProjectileEntity.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-08-30 17:29:46 +0200
committermadmaxoft <github@xoft.cz>2013-08-30 17:29:46 +0200
commit88f3fe7f000992fe7a3c47d4e235f725e9b77b69 (patch)
treed6b7590cc71e3849ae3388760bb2c87b03d6c4be /source/Entities/ProjectileEntity.cpp
parentUpdated ProtectionAreas to the latest version. (diff)
downloadcuberite-88f3fe7f000992fe7a3c47d4e235f725e9b77b69.tar
cuberite-88f3fe7f000992fe7a3c47d4e235f725e9b77b69.tar.gz
cuberite-88f3fe7f000992fe7a3c47d4e235f725e9b77b69.tar.bz2
cuberite-88f3fe7f000992fe7a3c47d4e235f725e9b77b69.tar.lz
cuberite-88f3fe7f000992fe7a3c47d4e235f725e9b77b69.tar.xz
cuberite-88f3fe7f000992fe7a3c47d4e235f725e9b77b69.tar.zst
cuberite-88f3fe7f000992fe7a3c47d4e235f725e9b77b69.zip
Diffstat (limited to '')
-rw-r--r--source/Entities/ProjectileEntity.cpp32
1 files changed, 1 insertions, 31 deletions
diff --git a/source/Entities/ProjectileEntity.cpp b/source/Entities/ProjectileEntity.cpp
index f405e9aa4..1dbc46ca1 100644
--- a/source/Entities/ProjectileEntity.cpp
+++ b/source/Entities/ProjectileEntity.cpp
@@ -230,7 +230,7 @@ cArrowEntity::cArrowEntity(cEntity * a_Creator, double a_X, double a_Y, double a
cArrowEntity::cArrowEntity(cPlayer & a_Player, double a_Force) :
- super(pkArrow, &a_Player, PosFromPlayerPos(a_Player), SpeedFromPlayerLook(a_Player, a_Force), 0.5, 0.5),
+ super(pkArrow, &a_Player, a_Player.GetThrowStartPos(), a_Player.GetThrowSpeed(a_Force * 1.5 * 20), 0.5, 0.5),
m_PickupState(psInSurvivalOrCreative),
m_DamageCoeff(2)
{
@@ -240,36 +240,6 @@ cArrowEntity::cArrowEntity(cPlayer & a_Player, double a_Force) :
-Vector3d cArrowEntity::PosFromPlayerPos(const cPlayer & a_Player)
-{
- Vector3d res = a_Player.GetEyePosition();
-
- // Adjust the position to be just outside the player's bounding box:
- res.x += 0.16 * cos(a_Player.GetPitch());
- res.y += -0.1;
- res.z += 0.16 * sin(a_Player.GetPitch());
-
- return res;
-}
-
-
-
-
-
-Vector3d cArrowEntity::SpeedFromPlayerLook(const cPlayer & a_Player, double a_Force)
-{
- Vector3d res = a_Player.GetLookVector();
- res.Normalize();
-
- // TODO: Add a slight random change (+-0.0075 in each direction)
-
- return res * a_Force * 1.5 * 20;
-}
-
-
-
-
-
bool cArrowEntity::CanPickup(const cPlayer & a_Player) const
{
switch (m_PickupState)