- Fixed a lot of astethics
This commit is contained in:
parent
7993caa553
commit
2c103a713e
@ -10,7 +10,6 @@
|
|||||||
#include "../Entities/ArrowEntity.h"
|
#include "../Entities/ArrowEntity.h"
|
||||||
#include "../Entities/FireChargeEntity.h"
|
#include "../Entities/FireChargeEntity.h"
|
||||||
#include "../Entities/ProjectileEntity.h"
|
#include "../Entities/ProjectileEntity.h"
|
||||||
#include "../Matrix4.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -150,7 +149,6 @@ void cDispenserEntity::DropSpenseFromSlot(cChunk & a_Chunk, int a_SlotNum)
|
|||||||
case E_ITEM_FIRE_CHARGE:
|
case E_ITEM_FIRE_CHARGE:
|
||||||
{
|
{
|
||||||
SpawnProjectileFromDispenser(BlockX, DispY, BlockZ, cProjectileEntity::pkFireCharge, GetShootVector(Meta) * 20);
|
SpawnProjectileFromDispenser(BlockX, DispY, BlockZ, cProjectileEntity::pkFireCharge, GetShootVector(Meta) * 20);
|
||||||
|
|
||||||
m_Contents.ChangeSlotCount(a_SlotNum, -1);
|
m_Contents.ChangeSlotCount(a_SlotNum, -1);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -159,7 +157,6 @@ void cDispenserEntity::DropSpenseFromSlot(cChunk & a_Chunk, int a_SlotNum)
|
|||||||
case E_ITEM_ARROW:
|
case E_ITEM_ARROW:
|
||||||
{
|
{
|
||||||
SpawnProjectileFromDispenser(BlockX, DispY, BlockZ, cProjectileEntity::pkArrow, GetShootVector(Meta) * 20);
|
SpawnProjectileFromDispenser(BlockX, DispY, BlockZ, cProjectileEntity::pkArrow, GetShootVector(Meta) * 20);
|
||||||
|
|
||||||
m_Contents.ChangeSlotCount(a_SlotNum, -1);
|
m_Contents.ChangeSlotCount(a_SlotNum, -1);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -168,7 +165,6 @@ void cDispenserEntity::DropSpenseFromSlot(cChunk & a_Chunk, int a_SlotNum)
|
|||||||
case E_ITEM_SNOWBALL:
|
case E_ITEM_SNOWBALL:
|
||||||
{
|
{
|
||||||
SpawnProjectileFromDispenser(BlockX, DispY, BlockZ, cProjectileEntity::pkSnowball, GetShootVector(Meta) * 20);
|
SpawnProjectileFromDispenser(BlockX, DispY, BlockZ, cProjectileEntity::pkSnowball, GetShootVector(Meta) * 20);
|
||||||
|
|
||||||
m_Contents.ChangeSlotCount(a_SlotNum, -1);
|
m_Contents.ChangeSlotCount(a_SlotNum, -1);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -177,7 +173,6 @@ void cDispenserEntity::DropSpenseFromSlot(cChunk & a_Chunk, int a_SlotNum)
|
|||||||
case E_ITEM_EGG:
|
case E_ITEM_EGG:
|
||||||
{
|
{
|
||||||
SpawnProjectileFromDispenser(BlockX, DispY, BlockZ, cProjectileEntity::pkEgg, GetShootVector(Meta) * 20);
|
SpawnProjectileFromDispenser(BlockX, DispY, BlockZ, cProjectileEntity::pkEgg, GetShootVector(Meta) * 20);
|
||||||
|
|
||||||
m_Contents.ChangeSlotCount(a_SlotNum, -1);
|
m_Contents.ChangeSlotCount(a_SlotNum, -1);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -202,10 +197,12 @@ void cDispenserEntity::DropSpenseFromSlot(cChunk & a_Chunk, int a_SlotNum)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void cDispenserEntity::SpawnProjectileFromDispenser(int & a_BlockX, int & a_BlockY, int & a_BlockZ, cProjectileEntity::eKind a_kind, Vector3d a_ShootVector)
|
void cDispenserEntity::SpawnProjectileFromDispenser(int & a_BlockX, int & a_BlockY, int & a_BlockZ, cProjectileEntity::eKind a_Kind, Vector3d a_ShootVector)
|
||||||
{
|
{
|
||||||
if(a_kind != cProjectileEntity::pkFireCharge)
|
if( a_kind != cProjectileEntity::pkFireCharge )
|
||||||
|
{
|
||||||
a_ShootVector.y = a_ShootVector.y + 1;
|
a_ShootVector.y = a_ShootVector.y + 1;
|
||||||
|
}
|
||||||
|
|
||||||
m_World->CreateProjectile((double) a_BlockX + 0.5, (double) a_BlockY + 0.5, (double) a_BlockZ + 0.5, a_kind, NULL, NULL, &a_ShootVector);
|
m_World->CreateProjectile((double) a_BlockX + 0.5, (double) a_BlockY + 0.5, (double) a_BlockZ + 0.5, a_kind, NULL, NULL, &a_ShootVector);
|
||||||
}
|
}
|
||||||
@ -215,14 +212,14 @@ Vector3d cDispenserEntity::GetShootVector(NIBBLETYPE & a_Meta)
|
|||||||
{
|
{
|
||||||
switch(a_Meta)
|
switch(a_Meta)
|
||||||
{
|
{
|
||||||
case E_META_DROPSPENSER_FACING_YP: return Vector3d(0, 1, 0); // UP
|
case E_META_DROPSPENSER_FACING_YP: return Vector3d(0, 1, 0); // UP
|
||||||
case E_META_DROPSPENSER_FACING_YM: return Vector3d(0, -1, 0); // DOWN
|
case E_META_DROPSPENSER_FACING_YM: return Vector3d(0, -1, 0); // DOWN
|
||||||
|
|
||||||
case E_META_DROPSPENSER_FACING_XM: return Vector3d(-1, 0, 0); // WEST
|
case E_META_DROPSPENSER_FACING_XM: return Vector3d(-1, 0, 0); // WEST
|
||||||
case E_META_DROPSPENSER_FACING_XP: return Vector3d(1, 0, 0); // EAST
|
case E_META_DROPSPENSER_FACING_XP: return Vector3d(1, 0, 0); // EAST
|
||||||
|
|
||||||
case E_META_DROPSPENSER_FACING_ZM: return Vector3d(0, 0, -1);
|
case E_META_DROPSPENSER_FACING_ZM: return Vector3d(0, 0, -1);
|
||||||
case E_META_DROPSPENSER_FACING_ZP: return Vector3d(0, 0, 1);
|
case E_META_DROPSPENSER_FACING_ZP: return Vector3d(0, 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Vector3d(0, 1, 0);
|
return Vector3d(0, 1, 0);
|
||||||
@ -290,3 +287,6 @@ bool cDispenserEntity::EmptyLiquidBucket(BLOCKTYPE a_BlockInFront, int a_SlotNum
|
|||||||
m_Contents.AddItem(EmptyBucket);
|
m_Contents.AddItem(EmptyBucket);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ public:
|
|||||||
static const char * GetClassStatic(void) { return "cDispenserEntity"; }
|
static const char * GetClassStatic(void) { return "cDispenserEntity"; }
|
||||||
|
|
||||||
/** Spawns a projectile of the given kind in front of the dispenser */
|
/** Spawns a projectile of the given kind in front of the dispenser */
|
||||||
void SpawnProjectileFromDispenser(int & a_BlockX, int & a_BlockY, int & a_BlockZ, cProjectileEntity::eKind a_kind, Vector3d a_ShootVector);
|
void SpawnProjectileFromDispenser(int & a_BlockX, int & a_BlockY, int & a_BlockZ, cProjectileEntity::eKind a_Kind, Vector3d a_ShootVector);
|
||||||
|
|
||||||
/** Returns how to aim the projectile */
|
/** Returns how to aim the projectile */
|
||||||
Vector3d GetShootVector(NIBBLETYPE & a_Meta);
|
Vector3d GetShootVector(NIBBLETYPE & a_Meta);
|
||||||
@ -38,3 +38,6 @@ private:
|
|||||||
/// If the a_BlockInFront is liquidable and the empty bucket can fit, does the m_Contents processing and returns true
|
/// If the a_BlockInFront is liquidable and the empty bucket can fit, does the m_Contents processing and returns true
|
||||||
bool EmptyLiquidBucket(BLOCKTYPE a_BlockInFront, int a_SlotNum);
|
bool EmptyLiquidBucket(BLOCKTYPE a_BlockInFront, int a_SlotNum);
|
||||||
} ; // tolua_export
|
} ; // tolua_export
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user