diff options
author | Mattes D <github@xoft.cz> | 2013-11-27 09:23:17 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2013-11-27 09:23:17 +0100 |
commit | 49760db89d94ede5d123d927141a6cd60dbaaf07 (patch) | |
tree | 6c6cf99e4cf3128311a93cd187947b502f3732a0 /source/Entities/ExpOrb.cpp | |
parent | cWorld::SpawnExperienceOrb() now returns the entity ID of the spawned orb. (diff) | |
parent | Fixed VC2008 compilation, normalized include paths. (diff) | |
download | cuberite-49760db89d94ede5d123d927141a6cd60dbaaf07.tar cuberite-49760db89d94ede5d123d927141a6cd60dbaaf07.tar.gz cuberite-49760db89d94ede5d123d927141a6cd60dbaaf07.tar.bz2 cuberite-49760db89d94ede5d123d927141a6cd60dbaaf07.tar.lz cuberite-49760db89d94ede5d123d927141a6cd60dbaaf07.tar.xz cuberite-49760db89d94ede5d123d927141a6cd60dbaaf07.tar.zst cuberite-49760db89d94ede5d123d927141a6cd60dbaaf07.zip |
Diffstat (limited to 'source/Entities/ExpOrb.cpp')
-rw-r--r-- | source/Entities/ExpOrb.cpp | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/source/Entities/ExpOrb.cpp b/source/Entities/ExpOrb.cpp deleted file mode 100644 index 1e5ee00ce..000000000 --- a/source/Entities/ExpOrb.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include "Globals.h" - -#include "ExpOrb.h" -#include "Player.h" -#include "../ClientHandle.h" - - -cExpOrb::cExpOrb(double a_X, double a_Y, double a_Z, int a_Reward) : - cEntity(etExpOrb, a_X, a_Y, a_Z, 0.98, 0.98), - m_Reward(a_Reward) -{ -} - - - - - -cExpOrb::cExpOrb(const Vector3d & a_Pos, int a_Reward) : - cEntity(etExpOrb, a_Pos.x, a_Pos.y, a_Pos.z, 0.98, 0.98), - m_Reward(a_Reward) -{ -} - - - - - -void cExpOrb::SpawnOn(cClientHandle & a_Client) -{ - a_Client.SendExperienceOrb(*this); - m_bDirtyPosition = false; - m_bDirtySpeed = false; - m_bDirtyOrientation = false; - m_bDirtyHead = false; -} - - - - - -void cExpOrb::Tick(float a_Dt, cChunk & a_Chunk) -{ - cPlayer * a_ClosestPlayer(m_World->FindClosestPlayer(Vector3f(GetPosition()), 4)); - if (a_ClosestPlayer) - { - Vector3f a_PlayerPos(a_ClosestPlayer->GetPosition()); - Vector3f a_Distance(a_PlayerPos - GetPosition()); - if (a_Distance.Length() < 0.1f) - { - a_ClosestPlayer->DeltaExperience(m_Reward); - a_ClosestPlayer->SendExperience(); - Destroy(true); - } - a_Distance.y = 0; - a_Distance.Normalize(); - a_Distance *= 3; - SetSpeedX( a_Distance.x ); - SetSpeedZ( a_Distance.z ); - } -}
\ No newline at end of file |