diff options
author | jfhumann <j.f.humann@gmail.com> | 2014-04-19 20:51:52 +0200 |
---|---|---|
committer | jfhumann <j.f.humann@gmail.com> | 2014-04-19 20:51:52 +0200 |
commit | f48d43f050683488b4cdbddcc92cfc7804112c11 (patch) | |
tree | 1fb33ed7227f1099851338937a5c658368774f01 | |
parent | Declared one mutex as mutable in order to allow for const correct get accessors. (diff) | |
download | cuberite-f48d43f050683488b4cdbddcc92cfc7804112c11.tar cuberite-f48d43f050683488b4cdbddcc92cfc7804112c11.tar.gz cuberite-f48d43f050683488b4cdbddcc92cfc7804112c11.tar.bz2 cuberite-f48d43f050683488b4cdbddcc92cfc7804112c11.tar.lz cuberite-f48d43f050683488b4cdbddcc92cfc7804112c11.tar.xz cuberite-f48d43f050683488b4cdbddcc92cfc7804112c11.tar.zst cuberite-f48d43f050683488b4cdbddcc92cfc7804112c11.zip |
-rw-r--r-- | src/BlockEntities/DispenserEntity.cpp | 10 | ||||
-rw-r--r-- | src/Entities/Minecart.cpp | 3 | ||||
-rw-r--r-- | src/Entities/Player.cpp | 4 | ||||
-rw-r--r-- | src/Entities/Player.h | 2 |
4 files changed, 10 insertions, 9 deletions
diff --git a/src/BlockEntities/DispenserEntity.cpp b/src/BlockEntities/DispenserEntity.cpp index f5b9c8923..2a32f69d9 100644 --- a/src/BlockEntities/DispenserEntity.cpp +++ b/src/BlockEntities/DispenserEntity.cpp @@ -128,11 +128,11 @@ void cDispenserEntity::DropSpenseFromSlot(cChunk & a_Chunk, int a_SlotNum) if (DispChunk->GetBlock(DispX, DispY, DispZ) == E_BLOCK_AIR) { DispChunk->SetBlock(DispX, DispY, DispZ, E_BLOCK_FIRE, 0); - const cItem& slot = m_Contents.GetSlot(a_SlotNum); - m_Contents.SetSlot(a_SlotNum, slot.m_ItemType, slot.m_ItemCount, slot.m_ItemDamage + 1); - // If the durability has run out destroy the item. - if (m_Contents.GetSlot(a_SlotNum).m_ItemDamage > 64) - { + + bool ItemBroke = m_Contents.DamageItem(a_SlotNum, 1); + + if (ItemBroke) + { m_Contents.ChangeSlotCount(a_SlotNum, -1); } } diff --git a/src/Entities/Minecart.cpp b/src/Entities/Minecart.cpp index db55eb058..7fe0b3cb1 100644 --- a/src/Entities/Minecart.cpp +++ b/src/Entities/Minecart.cpp @@ -796,7 +796,8 @@ bool cMinecart::TestBlockCollision(NIBBLETYPE a_RailMeta) BLOCKTYPE BlockXM = m_World->GetBlock(POSX_TOINT - 1, POSY_TOINT, POSZ_TOINT); BLOCKTYPE BlockXP = m_World->GetBlock(POSX_TOINT + 1, POSY_TOINT, POSZ_TOINT); BLOCKTYPE BlockZM = m_World->GetBlock(POSX_TOINT, POSY_TOINT, POSZ_TOINT - 1); - BLOCKTYPE BlockZP = m_World->GetBlock(POSX_TOINT, POSY_TOINT, POSZ_TOINT + 1); + // FIXME: Should the next line be POSZ_TOINT + 1? Else add some documenttation why - 1 + BLOCKTYPE BlockZP = m_World->GetBlock(POSX_TOINT, POSY_TOINT, POSZ_TOINT - 1); if ( (!IsBlockRail(BlockXM) && cBlockInfo::IsSolid(BlockXM)) || (!IsBlockRail(BlockXP) && cBlockInfo::IsSolid(BlockXP)) || diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 46edb7199..fedb62527 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -1166,9 +1166,9 @@ Vector3d cPlayer::GetThrowSpeed(double a_SpeedCoeff) const -void cPlayer::ForceSetSpeed(const Vector3d & a_Direction) +void cPlayer::ForceSetSpeed(const Vector3d & a_Speed) { - SetSpeed(a_Direction); + SetSpeed(a_Speed); m_ClientHandle->SendEntityVelocity(*this); } diff --git a/src/Entities/Player.h b/src/Entities/Player.h index 74da409cf..78d661015 100644 --- a/src/Entities/Player.h +++ b/src/Entities/Player.h @@ -181,7 +181,7 @@ public: void LoginSetGameMode(eGameMode a_GameMode); /** Forces the player to move in the given direction. */ - void ForceSetSpeed(const Vector3d & a_Direction); // tolua_export + void ForceSetSpeed(const Vector3d & a_Speed); // tolua_export /** Tries to move to a new position, with attachment-related checks (y == -999) */ void MoveTo(const Vector3d & a_NewPos); // tolua_export |