From 3daf805350d85d0a6eb0b7e2f647150b75a10947 Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Thu, 2 Jan 2014 03:39:22 +0100 Subject: [PATCH] Table: Serialize actual table dimensions instead of '3' This allows savegames created with mkxp to be read with RMXP. --- src/table.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/table.cpp b/src/table.cpp index 77f0217..22a9e7d 100644 --- a/src/table.cpp +++ b/src/table.cpp @@ -173,7 +173,17 @@ void Table::serialize(char *buffer) const { char *buff_p = buffer; - write_int32(&buff_p, 3); + /* Table dimensions: we don't care + * about them but RMXP needs them */ + int dim = 1; + + if (m_y > 1) + dim = 2; + + if (m_z > 1) + dim = 3; + + write_int32(&buff_p, dim); write_int32(&buff_p, m_x); write_int32(&buff_p, m_y); write_int32(&buff_p, m_z);