summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities/DispenserEntity.cpp
diff options
context:
space:
mode:
authorJoannisO <Joannis.Orlandos@gmail.com>2014-05-29 20:19:36 +0200
committerJoannisO <Joannis.Orlandos@gmail.com>2014-05-29 20:19:36 +0200
commitab633c8bd65b333630053334cb1119f38788698d (patch)
treed67256add9bae0fca4e784ee25a19f5569f37834 /src/BlockEntities/DispenserEntity.cpp
parent- Removed breaks. I thought it wouldn't compile without them but the (diff)
downloadcuberite-ab633c8bd65b333630053334cb1119f38788698d.tar
cuberite-ab633c8bd65b333630053334cb1119f38788698d.tar.gz
cuberite-ab633c8bd65b333630053334cb1119f38788698d.tar.bz2
cuberite-ab633c8bd65b333630053334cb1119f38788698d.tar.lz
cuberite-ab633c8bd65b333630053334cb1119f38788698d.tar.xz
cuberite-ab633c8bd65b333630053334cb1119f38788698d.tar.zst
cuberite-ab633c8bd65b333630053334cb1119f38788698d.zip
Diffstat (limited to 'src/BlockEntities/DispenserEntity.cpp')
-rw-r--r--src/BlockEntities/DispenserEntity.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/BlockEntities/DispenserEntity.cpp b/src/BlockEntities/DispenserEntity.cpp
index 341994be8..799d41a1e 100644
--- a/src/BlockEntities/DispenserEntity.cpp
+++ b/src/BlockEntities/DispenserEntity.cpp
@@ -196,15 +196,15 @@ void cDispenserEntity::DropSpenseFromSlot(cChunk & a_Chunk, int a_SlotNum)
-void cDispenserEntity::SpawnProjectileFromDispenser(cChunk & a_Chunk, int & DispX, int & DispY, int & DispZ, cProjectileEntity::eKind kind)
+void cDispenserEntity::SpawnProjectileFromDispenser(cChunk & a_Chunk, int & a_DispX, int & a_DispY, int & a_DispZ, cProjectileEntity::eKind a_kind)
{
Vector3d Angle = GetProjectileLookVector(a_Chunk);
- cChunk * DispChunk = a_Chunk.GetRelNeighborChunkAdjustCoords(DispX, DispZ);
+ cChunk * DispChunk = a_Chunk.GetRelNeighborChunkAdjustCoords(a_DispX, a_DispZ);
- double EntityX = 0.5 + (DispX + DispChunk->GetPosX() * cChunkDef::Width);
- double EntityZ = 0.5 + (DispZ + DispChunk->GetPosZ() * cChunkDef::Width);
+ double EntityX = 0.5 + (a_DispX + DispChunk->GetPosX() * cChunkDef::Width);
+ double EntityZ = 0.5 + (a_DispZ + DispChunk->GetPosZ() * cChunkDef::Width);
- m_World->CreateProjectile((double) EntityX, (double) DispY + 0.5, (double) EntityZ, kind, NULL, NULL, &Angle);
+ m_World->CreateProjectile((double) EntityX, (double) a_DispY + 0.5, (double) EntityZ, a_kind, NULL, NULL, &Angle);
}
@@ -219,16 +219,20 @@ Vector3d cDispenserEntity::GetProjectileLookVector(cChunk & a_Chunk)
switch (Meta)
{
case E_META_DROPSPENSER_FACING_YP:
+ {
m.Init(Vector3d(), 0, 180, 0);
Look = m.Transform(Vector3d(0, 1, 0));
return Look * 20; // UP
+ }
case E_META_DROPSPENSER_FACING_YM:
+ {
m.Init(Vector3d(), 0, -360, 0);
Look = m.Transform(Vector3d(0, -1, 0));
return Look * 20;; // DOWN
+ }
case E_META_DROPSPENSER_FACING_XM: Direction = 90; break; // WEST
case E_META_DROPSPENSER_FACING_XP: Direction = 270; break; // EAST