diff --git a/src/save_loader/save.cpp b/src/save_loader/save.cpp index 7593e69..37920ad 100644 --- a/src/save_loader/save.cpp +++ b/src/save_loader/save.cpp @@ -396,12 +396,22 @@ void mech_segment::mech::load(const buffer &b) // if ((uint32_t)g_unk3 == 0) // if (unk13[0] == 5) //if (g_unk6[26][0] != 0 && strcmp((const char *)b.getPtr(), "GROUPS") != 0) + //if (f == 1) { float g_unk7 = 0; float g_unk8 = 0; uint32_t g_unk9 = 0; uint8_t g_unk10 = 0; + // hack on + if (b.eof()) + return; + READ(b, g_unk10); + b.skip(-1); + if (g_unk10 == 3) + return; + // hack off + READ(b, g_unk7); /*if (g_unk7 != 0) { @@ -413,7 +423,7 @@ void mech_segment::mech::load(const buffer &b) READ(b, g_unk10); if (g_unk10 > 1) - std::cerr << "g_unk10 > 1" << "\n"; + std::cerr << "g_unk10 (" << (int)g_unk10 << ") > 1" << "\n"; if (g_unk10) gl.load(b); @@ -750,7 +760,7 @@ void segment_desc::load(const buffer &b) CASE("ENV", env_segment); CASE("ORGREL", orgrel_segment); CASE("OTHERS", others_segment); - //CASE("MECH", mech_segment); + CASE("MECH", mech_segment); // CASE("GROUPS", groups_segment); CASE("ORGDATA", orgdata_segment); CASE("BUILDS", builds_segment); diff --git a/src/save_loader/save.h b/src/save_loader/save.h index aa4f2eb..3b4bfba 100644 --- a/src/save_loader/save.h +++ b/src/save_loader/save.h @@ -384,9 +384,9 @@ struct mech_segment : public segment enum class MechFlags : uint32_t { - unk0 = 0x1, - unk1 = 0x0100, - Dead = 0x010000, + unk0 = 0x00000001, + unk1 = 0x00000100, + Dead = 0x00010000, Dead2 = 0x01000000, };