summaryrefslogtreecommitdiffstats
path: root/source/World.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/World.cpp')
-rw-r--r--source/World.cpp28
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);