summaryrefslogtreecommitdiffstats
path: root/source/WorldStorage/FastNBT.cpp
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-11-16 23:06:12 +0100
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-11-16 23:06:12 +0100
commit8ad774790267b7fc76e187a122e37e44dd222e64 (patch)
tree54b969accc23bcabd5b0724e369872d5f67d644d /source/WorldStorage/FastNBT.cpp
parentFixed boolean comparison. (diff)
downloadcuberite-8ad774790267b7fc76e187a122e37e44dd222e64.tar
cuberite-8ad774790267b7fc76e187a122e37e44dd222e64.tar.gz
cuberite-8ad774790267b7fc76e187a122e37e44dd222e64.tar.bz2
cuberite-8ad774790267b7fc76e187a122e37e44dd222e64.tar.lz
cuberite-8ad774790267b7fc76e187a122e37e44dd222e64.tar.xz
cuberite-8ad774790267b7fc76e187a122e37e44dd222e64.tar.zst
cuberite-8ad774790267b7fc76e187a122e37e44dd222e64.zip
Diffstat (limited to 'source/WorldStorage/FastNBT.cpp')
-rw-r--r--source/WorldStorage/FastNBT.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/WorldStorage/FastNBT.cpp b/source/WorldStorage/FastNBT.cpp
index 397df036e..a81be9a89 100644
--- a/source/WorldStorage/FastNBT.cpp
+++ b/source/WorldStorage/FastNBT.cpp
@@ -503,17 +503,26 @@ void cFastNBTWriter::AddIntArray(const AString & a_Name, const int * a_Value, si
TagCommon(a_Name, TAG_IntArray);
Int32 len = htonl(a_NumElements);
m_Result.append((const char *)&len, 4);
+#if defined(ANDROID_NDK)
+ for (size_t i = 0; i < a_NumElements; i++)
+ {
+ int Element = htonl(a_Value[i]);
+ m_Result.append((const char *)&Element, 4);
+ }
+#else
int * Elements = (int *)(m_Result.data() + m_Result.size());
m_Result.append(a_NumElements * 4, (char)0);
for (size_t i = 0; i < a_NumElements; i++)
{
Elements[i] = htonl(a_Value[i]);
}
+#endif
}
+
void cFastNBTWriter::Finish(void)
{
ASSERT(m_CurrentStack == 0);