This commit is contained in:
MarcEricMartel
2023-12-02 11:05:00 -05:00
parent 20eb410b08
commit 5a491c5446
10 changed files with 63 additions and 26 deletions

View File

@@ -425,8 +425,9 @@ void netprot::Serialize(ChunkMod* chmod, char* buf[], uint32_t* buflen) {
memcpy(*buf + 1, vec8, sizeof(uint32_t) * 3);
memcpy(*buf + sizeof(uint32_t) * 3 + 1, &chmod->b_type, sizeof(BlockType));
memcpy(*buf + sizeof(uint32_t) * 3 + 2, &chmod->old_b_type, sizeof(BlockType));
*buflen = sizeof(uint32_t) * 3 + 2;
*buflen = sizeof(uint32_t) * 3 + 3;
}
void netprot::Serialize(ErrorLog* errlog, char* buf[], uint32_t* buflen) {
@@ -868,8 +869,9 @@ bool netprot::Deserialize(ChunkMod* chmod, char* buf, uint32_t* buflen) {
memcpy(&chmod->pos, vec, sizeof(uint32_t) * 3);
memcpy(&chmod->b_type, &buf[1 + sizeof(uint8_t) * 12], sizeof(BlockType));
memcpy(&chmod->old_b_type, &buf[2 + sizeof(uint8_t) * 12], sizeof(BlockType));
*buflen = sizeof(uint32_t) * 3 + 2;
*buflen = sizeof(uint32_t) * 3 + 3;
return true;
}