summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ByteBuffer.cpp2
-rw-r--r--src/ClientHandle.cpp32
-rw-r--r--src/Inventory.cpp2
-rw-r--r--src/Protocol/MojangAPI.cpp6
4 files changed, 23 insertions, 19 deletions
diff --git a/src/ByteBuffer.cpp b/src/ByteBuffer.cpp
index 64b31c60b..96556bf61 100644
--- a/src/ByteBuffer.cpp
+++ b/src/ByteBuffer.cpp
@@ -27,7 +27,7 @@
)
#define IS_LITTLE_ENDIAN
#elif ( \
- defined (__ARMEB__) || defined(__sparc) \
+ defined (__ARMEB__) || defined(__sparc) || defined(__powerpc__) || defined(__POWERPC__) \
)
#define IS_BIG_ENDIAN
#else
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index ee4fdfa7d..8aa883144 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -922,11 +922,16 @@ void cClientHandle::HandleLeftClick(int a_BlockX, int a_BlockY, int a_BlockZ, eB
return;
}
- // Check for clickthrough-blocks:
- /* When the user breaks a fire block, the client send the wrong block location.
- We must find the right block with the face direction. */
- if (a_BlockFace != BLOCK_FACE_NONE)
+ if ((a_Status == DIG_STATUS_STARTED) || (a_Status == DIG_STATUS_FINISHED))
{
+ if (a_BlockFace == BLOCK_FACE_NONE)
+ {
+ return;
+ }
+
+ /* Check for clickthrough-blocks:
+ When the user breaks a fire block, the client send the wrong block location.
+ We must find the right block with the face direction. */
int BlockX = a_BlockX;
int BlockY = a_BlockY;
int BlockZ = a_BlockZ;
@@ -937,17 +942,16 @@ void cClientHandle::HandleLeftClick(int a_BlockX, int a_BlockY, int a_BlockZ, eB
a_BlockY = BlockY;
a_BlockZ = BlockZ;
}
- }
- if (
- ((a_Status == DIG_STATUS_STARTED) || (a_Status == DIG_STATUS_FINISHED)) && // Only do a radius check for block destruction - things like pickup tossing send coordinates that are to be ignored
- ((Diff(m_Player->GetPosX(), (double)a_BlockX) > 6) ||
- (Diff(m_Player->GetPosY(), (double)a_BlockY) > 6) ||
- (Diff(m_Player->GetPosZ(), (double)a_BlockZ) > 6))
- )
- {
- m_Player->GetWorld()->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, m_Player);
- return;
+ if (
+ ((Diff(m_Player->GetPosX(), (double)a_BlockX) > 6) ||
+ (Diff(m_Player->GetPosY(), (double)a_BlockY) > 6) ||
+ (Diff(m_Player->GetPosZ(), (double)a_BlockZ) > 6))
+ )
+ {
+ m_Player->GetWorld()->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, m_Player);
+ return;
+ }
}
cPluginManager * PlgMgr = cRoot::Get()->GetPluginManager();
diff --git a/src/Inventory.cpp b/src/Inventory.cpp
index 8da3dea5f..832a079bc 100644
--- a/src/Inventory.cpp
+++ b/src/Inventory.cpp
@@ -106,7 +106,7 @@ int cInventory::AddItem(const cItem & a_Item, bool a_AllowNewStacks, bool a_tryT
// When the item is a armor, try to set it directly to the armor slot.
if (ItemCategory::IsArmor(a_Item.m_ItemType))
{
- for (size_t i = 0; i < (size_t)m_ArmorSlots.GetNumSlots(); i++)
+ for (int i = 0; i < m_ArmorSlots.GetNumSlots(); i++)
{
if (m_ArmorSlots.GetSlot(i).IsEmpty() && cSlotAreaArmor::CanPlaceArmorInSlot(i, a_Item))
{
diff --git a/src/Protocol/MojangAPI.cpp b/src/Protocol/MojangAPI.cpp
index 3786fecc9..4e5c41a8a 100644
--- a/src/Protocol/MojangAPI.cpp
+++ b/src/Protocol/MojangAPI.cpp
@@ -658,11 +658,11 @@ void cMojangAPI::CacheNamesToUUIDs(const AStringVector & a_PlayerNames)
}
// Store the returned results into cache:
- size_t JsonCount = root.size();
+ Json::Value::UInt JsonCount = root.size();
Int64 Now = time(NULL);
{
cCSLock Lock(m_CSNameToUUID);
- for (size_t idx = 0; idx < JsonCount; ++idx)
+ for (Json::Value::UInt idx = 0; idx < JsonCount; ++idx)
{
Json::Value & Val = root[idx];
AString JsonName = Val.get("name", "").asString();
@@ -679,7 +679,7 @@ void cMojangAPI::CacheNamesToUUIDs(const AStringVector & a_PlayerNames)
// Also cache the UUIDToName:
{
cCSLock Lock(m_CSUUIDToName);
- for (size_t idx = 0; idx < JsonCount; ++idx)
+ for (Json::Value::UInt idx = 0; idx < JsonCount; ++idx)
{
Json::Value & Val = root[idx];
AString JsonName = Val.get("name", "").asString();