summaryrefslogtreecommitdiffstats
path: root/src/Items
diff options
context:
space:
mode:
authorAlex <sweet.giorni@gmail.com>2017-02-20 10:03:19 +0100
committerMattes D <github@xoft.cz>2017-02-20 10:03:19 +0100
commit9cb1ad546f09066cd9949fd0e4fa7fd2e54dd519 (patch)
tree628af192ab1a3827ee01fb7c9e7e6cadf62da4ca /src/Items
parentDead bushes will generate in mega mega taigas (#3571) (diff)
downloadcuberite-9cb1ad546f09066cd9949fd0e4fa7fd2e54dd519.tar
cuberite-9cb1ad546f09066cd9949fd0e4fa7fd2e54dd519.tar.gz
cuberite-9cb1ad546f09066cd9949fd0e4fa7fd2e54dd519.tar.bz2
cuberite-9cb1ad546f09066cd9949fd0e4fa7fd2e54dd519.tar.lz
cuberite-9cb1ad546f09066cd9949fd0e4fa7fd2e54dd519.tar.xz
cuberite-9cb1ad546f09066cd9949fd0e4fa7fd2e54dd519.tar.zst
cuberite-9cb1ad546f09066cd9949fd0e4fa7fd2e54dd519.zip
Diffstat (limited to 'src/Items')
-rw-r--r--src/Items/ItemFishingRod.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Items/ItemFishingRod.h b/src/Items/ItemFishingRod.h
index 3a2ef0275..fa27e08f6 100644
--- a/src/Items/ItemFishingRod.h
+++ b/src/Items/ItemFishingRod.h
@@ -35,6 +35,7 @@ public:
{
m_CanPickup = reinterpret_cast<cFloater *>(a_Entity)->CanPickup();
m_Pos = Vector3d(a_Entity->GetPosX(), a_Entity->GetPosY(), a_Entity->GetPosZ());
+ m_BitePos = reinterpret_cast<cFloater *>(a_Entity)->GetBitePos();
m_AttachedMobID = reinterpret_cast<cFloater *>(a_Entity)->GetAttachedMobID();
a_Entity->Destroy(true);
return true;
@@ -44,11 +45,13 @@ public:
bool IsAttached(void) const { return (m_AttachedMobID != cEntity::INVALID_ID); }
UInt32 GetAttachedMobID(void) const { return m_AttachedMobID; }
Vector3d GetPos(void) const { return m_Pos; }
+ Vector3d GetBitePos(void) const { return m_BitePos; }
protected:
bool m_CanPickup;
UInt32 m_AttachedMobID;
Vector3d m_Pos;
+ Vector3d m_BitePos;
} ;
@@ -236,9 +239,12 @@ public:
{
return true;
}
- Vector3d FloaterPos = FloaterInfo.GetPos();
+ Vector3d FloaterPos = FloaterInfo.GetBitePos();
+ FloaterPos.y += 0.5f;
+ const float FISH_SPEED_MULT = 2.25f;
+
Vector3d FlyDirection = a_Player->GetEyePosition() - FloaterPos;
- a_World->SpawnItemPickups(Drops, FloaterPos.x, FloaterPos.y, FloaterPos.z, FlyDirection.x, FlyDirection.y + 1, FlyDirection.z);
+ a_World->SpawnItemPickups(Drops, FloaterPos.x, FloaterPos.y, FloaterPos.z, FlyDirection.x * FISH_SPEED_MULT, (FlyDirection.y + 1.0f) * FISH_SPEED_MULT, FlyDirection.z * FISH_SPEED_MULT);
cRoot::Get()->GetPluginManager()->CallHookPlayerFished(*a_Player, Drops);
}
}