summaryrefslogtreecommitdiff
path: root/src/client/GameSave.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-08-20 15:48:03 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-08-20 15:48:03 (GMT)
commitb318c3721a43de9789efc6c286b41566649f5252 (patch)
tree861c1f51b18e7ba7525b2a4903d9c7998af4a00a /src/client/GameSave.cpp
parent13888623a5a7f6fa9f532570c1b733f0fcdf2a64 (diff)
downloadpowder-b318c3721a43de9789efc6c286b41566649f5252.zip
powder-b318c3721a43de9789efc6c286b41566649f5252.tar.gz
TPT: Powered pipe, based on jacob1's commits
Diffstat (limited to 'src/client/GameSave.cpp')
-rw-r--r--src/client/GameSave.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/client/GameSave.cpp b/src/client/GameSave.cpp
index 53366b0..002433e 100644
--- a/src/client/GameSave.cpp
+++ b/src/client/GameSave.cpp
@@ -832,6 +832,13 @@ void GameSave::readOPS(char * data, int dataLength)
{
if(i >= partsDataLen) goto fail;
particles[newIndex].tmp |= (((unsigned)partsData[i++]) << 8);
+ //Read 3rd and 4th bytes
+ if(fieldDescriptor & 0x1000)
+ {
+ if(i+1 >= partsDataLen) goto fail;
+ particles[newIndex].tmp |= (((unsigned)partsData[i++]) << 16);
+ particles[newIndex].tmp |= (((unsigned)partsData[i++]) << 24);
+ }
}
}
@@ -1795,6 +1802,12 @@ char * GameSave::serialiseOPS(int & dataLength)
{
fieldDesc |= 1 << 4;
partsData[partsDataLen++] = particles[i].tmp >> 8;
+ if(particles[i].tmp > 65535)
+ {
+ fieldDesc |= 1 << 12;
+ partsData[partsDataLen++] = (particles[i].tmp&0xFF000000)>>24;
+ partsData[partsDataLen++] = (particles[i].tmp&0x00FF0000)>>16;
+ }
}
}