diff options
author | madmaxoft <github@xoft.cz> | 2013-08-22 08:55:58 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-08-22 08:55:58 +0200 |
commit | 73afb1507d2a0defda8a03f60030dc49bb53f94f (patch) | |
tree | b5a14bb289756f734a8cc7e949e660298167627c /source/World.cpp | |
parent | Another fix for #31. (diff) | |
download | cuberite-73afb1507d2a0defda8a03f60030dc49bb53f94f.tar cuberite-73afb1507d2a0defda8a03f60030dc49bb53f94f.tar.gz cuberite-73afb1507d2a0defda8a03f60030dc49bb53f94f.tar.bz2 cuberite-73afb1507d2a0defda8a03f60030dc49bb53f94f.tar.lz cuberite-73afb1507d2a0defda8a03f60030dc49bb53f94f.tar.xz cuberite-73afb1507d2a0defda8a03f60030dc49bb53f94f.tar.zst cuberite-73afb1507d2a0defda8a03f60030dc49bb53f94f.zip |
Diffstat (limited to 'source/World.cpp')
-rw-r--r-- | source/World.cpp | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/source/World.cpp b/source/World.cpp index 053eaedc7..75e2d5fd1 100644 --- a/source/World.cpp +++ b/source/World.cpp @@ -5,8 +5,6 @@ #include "World.h" #include "ChunkDef.h" #include "ClientHandle.h" -#include "Entities/Pickup.h" -#include "Entities/Player.h" #include "Server.h" #include "Item.h" #include "Root.h" @@ -14,6 +12,11 @@ #include "ChunkMap.h" #include "OSSupport/Timer.h" +// Entities (except mobs): +#include "Entities/Pickup.h" +#include "Entities/Player.h" +#include "Entities/TNTEntity.h" + // Simulators: #include "Simulator/SimulatorManager.h" #include "Simulator/FloodyFluidSimulator.h" @@ -55,7 +58,6 @@ #include "PluginManager.h" #include "Blocks/BlockHandler.h" #include "Vector3d.h" -#include "Entities/TNTEntity.h" #include "Tracer.h" #include "tolua++.h" @@ -2650,6 +2652,26 @@ int cWorld::SpawnMob(double a_PosX, double a_PosY, double a_PosZ, cMonster::eTyp +int cWorld::CreateProjectile(double a_PosX, double a_PosY, double a_PosZ, cProjectileEntity::eKind a_Kind, cEntity * a_Creator, const Vector3d * a_Speed) +{ + cProjectileEntity * Projectile = cProjectileEntity::Create(a_Kind, a_Creator, a_PosX, a_PosY, a_PosZ, a_Speed); + if (Projectile == NULL) + { + return -1; + } + if (!Projectile->Initialize(this)) + { + delete Projectile; + return -1; + } + BroadcastSpawnEntity(*Projectile); + return Projectile->GetUniqueID(); +} + + + + + void cWorld::TabCompleteUserName(const AString & a_Text, AStringVector & a_Results) { cCSLock Lock(m_CSPlayers); |