summaryrefslogtreecommitdiffstats
path: root/source/World.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-06-18 21:09:51 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-06-18 21:09:51 +0200
commitb2138b132cc0f7bf03bdd723725729d76067ff23 (patch)
treed573bf041c1d47c7bf68cef49bae0be1d52ffc91 /source/World.cpp
parentTNT fixes. (diff)
downloadcuberite-b2138b132cc0f7bf03bdd723725729d76067ff23.tar
cuberite-b2138b132cc0f7bf03bdd723725729d76067ff23.tar.gz
cuberite-b2138b132cc0f7bf03bdd723725729d76067ff23.tar.bz2
cuberite-b2138b132cc0f7bf03bdd723725729d76067ff23.tar.lz
cuberite-b2138b132cc0f7bf03bdd723725729d76067ff23.tar.xz
cuberite-b2138b132cc0f7bf03bdd723725729d76067ff23.tar.zst
cuberite-b2138b132cc0f7bf03bdd723725729d76067ff23.zip
Diffstat (limited to '')
-rw-r--r--source/World.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/source/World.cpp b/source/World.cpp
index 51863919f..398077c61 100644
--- a/source/World.cpp
+++ b/source/World.cpp
@@ -55,6 +55,7 @@
#include "PluginManager.h"
#include "Blocks/BlockHandler.h"
#include "Vector3d.h"
+#include "TNTEntity.h"
#include "tolua++.h"
@@ -737,7 +738,8 @@ void cWorld::DoExplosiontAt(float a_ExplosionSize, int a_BlockX, int a_BlockY, i
{
// TODO: Add damage to entities, add support for pickups, and implement block hardiness
Vector3d explosion_pos = Vector3d(a_BlockX, a_BlockY, a_BlockZ);
- cVector3iArray * BlocksAffected = m_ChunkMap->DoExplosiontAt(a_ExplosionSize, a_BlockX, a_BlockY, a_BlockZ);
+ cVector3iArray BlocksAffected;
+ m_ChunkMap->DoExplosiontAt(a_ExplosionSize, a_BlockX, a_BlockY, a_BlockZ, BlocksAffected);
BroadcastSoundEffect("random.explode", a_BlockX * 8, a_BlockY * 8, a_BlockZ * 8, 1.0f, 0.6f);
{
cCSLock Lock(m_CSPlayers);
@@ -759,11 +761,10 @@ void cWorld::DoExplosiontAt(float a_ExplosionSize, int a_BlockX, int a_BlockY, i
}
distance_explosion.Normalize();
distance_explosion *= power;
- ch->SendExplosion(a_BlockX, a_BlockY, a_BlockZ, a_ExplosionSize, *BlocksAffected, distance_explosion);
+ ch->SendExplosion(a_BlockX, a_BlockY, a_BlockZ, a_ExplosionSize, BlocksAffected, distance_explosion);
}
}
}
- delete BlocksAffected;
}
@@ -1314,6 +1315,17 @@ void cWorld::SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double
+void cWorld::SpawnPrimedTNT(double a_X, double a_Y, double a_Z, float a_FuseTimeInSec)
+{
+ cTNTEntity * TNT = new cTNTEntity(a_X, a_Y, a_Z, a_FuseTimeInSec);
+ TNT->Initialize(this);
+ // TODO: Add a bit of speed in horiz and vert axes
+}
+
+
+
+
+
void cWorld::ReplaceBlocks(const sSetBlockVector & a_Blocks, BLOCKTYPE a_FilterBlockType)
{
m_ChunkMap->ReplaceBlocks(a_Blocks, a_FilterBlockType);