Table: Serialize actual table dimensions instead of '3'

This allows savegames created with mkxp to be read with RMXP.
This commit is contained in:
Jonas Kulla 2014-01-02 03:39:22 +01:00
parent 5f16eef273
commit 3daf805350
1 changed files with 11 additions and 1 deletions

View File

@ -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);