actually allow loading v2 and enable in converter

This commit is contained in:
Green Sky 2024-04-14 10:23:13 +02:00
parent de3b8f059e
commit a845609660
No known key found for this signature in database
2 changed files with 4 additions and 2 deletions

View File

@ -99,7 +99,7 @@ int main(int argc, const char** argv) {
// TODO: error handling
const auto j = nlohmann::json::parse(tmp_buffer);
if (false) {
if (true) {
e.e.replace<ObjComp::MessagesVersion>(uint16_t(2));
// overwrite og

View File

@ -607,7 +607,9 @@ float MessageFragmentStore::tick(float) {
// missing version, adding
fh.emplace<ObjComp::MessagesVersion>();
}
if (fh.get<ObjComp::MessagesVersion>().v != 1) {
const auto object_version = fh.get<ObjComp::MessagesVersion>().v;
// TODO: move this early version check somewhere else
if (object_version != 1 && object_version != 2) {
std::cerr << "MFS: object with version mismatch\n";
return 0.05f;
}