diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-04-23 22:06:07 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-04-23 22:06:07 +0200 |
commit | f763242e5c5d8e6469685c4be95d3dc264ed6a67 (patch) | |
tree | b6ce8b9927109ea9c4fe51ba7c4ce90dff05ec7c /src/Items | |
parent | Compilation fix (diff) | |
download | cuberite-f763242e5c5d8e6469685c4be95d3dc264ed6a67.tar cuberite-f763242e5c5d8e6469685c4be95d3dc264ed6a67.tar.gz cuberite-f763242e5c5d8e6469685c4be95d3dc264ed6a67.tar.bz2 cuberite-f763242e5c5d8e6469685c4be95d3dc264ed6a67.tar.lz cuberite-f763242e5c5d8e6469685c4be95d3dc264ed6a67.tar.xz cuberite-f763242e5c5d8e6469685c4be95d3dc264ed6a67.tar.zst cuberite-f763242e5c5d8e6469685c4be95d3dc264ed6a67.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Items/ItemLilypad.h | 14 | ||||
-rw-r--r-- | src/Items/ItemThrowable.h | 5 |
2 files changed, 10 insertions, 9 deletions
diff --git a/src/Items/ItemLilypad.h b/src/Items/ItemLilypad.h index 8fc1d8543..bc650cdbd 100644 --- a/src/Items/ItemLilypad.h +++ b/src/Items/ItemLilypad.h @@ -47,9 +47,9 @@ public: public cBlockTracer::cCallbacks { public: - cCallbacks(cWorld * a_CBWorld) : - m_HasHitFluid(false), - m_World(a_CBWorld) + + cCallbacks(void) : + m_HasHitFluid(false) { } @@ -62,10 +62,9 @@ public: return false; } AddFaceDirection(a_CBBlockX, a_CBBlockY, a_CBBlockZ, BLOCK_FACE_YP); // Always place pad at top of water block - BLOCKTYPE Block = m_World->GetBlock(a_CBBlockX, a_CBBlockY, a_CBBlockZ); if ( - !IsBlockWater(Block) && - cBlockInfo::FullyOccupiesVoxel(Block) + !IsBlockWater(a_CBBlockType) && + cBlockInfo::FullyOccupiesVoxel(a_CBBlockType) ) { // Can't place lilypad on air/in another block! @@ -80,11 +79,10 @@ public: Vector3i m_Pos; bool m_HasHitFluid; - cWorld * m_World; }; - cCallbacks Callbacks(a_World); + cCallbacks Callbacks; cLineBlockTracer Tracer(*a_Player->GetWorld(), Callbacks); Vector3d Start(a_Player->GetEyePosition() + a_Player->GetLookVector()); Vector3d End(a_Player->GetEyePosition() + a_Player->GetLookVector() * 5); diff --git a/src/Items/ItemThrowable.h b/src/Items/ItemThrowable.h index c6a4e714e..f90caf037 100644 --- a/src/Items/ItemThrowable.h +++ b/src/Items/ItemThrowable.h @@ -127,7 +127,10 @@ public: return false; } - a_World->CreateProjectile(a_BlockX + 0.5, a_BlockY + 1, a_BlockZ + 0.5, m_ProjectileKind, a_Player, a_Player->GetEquippedItem()); + if (a_World->CreateProjectile(a_BlockX + 0.5, a_BlockY + 1, a_BlockZ + 0.5, m_ProjectileKind, a_Player, a_Player->GetEquippedItem()) == -1) + { + return false; + } if (!a_Player->IsGameModeCreative()) { |