Skip to content

Commit

Permalink
move version to top of export json
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaFiorini committed Feb 18, 2025
1 parent 517e7d6 commit e3af50f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/order_cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,9 @@ std::string OrderList::ToJSONString()

nlohmann::ordered_json json;

json["version"] = ORDERLIST_JSON_OUTPUT_VERSION;
json["source"] = std::string(_openttd_revision);

if (this == nullptr) { //order list not intiailised, return an empty result
json["error"] = "Orderlist was not initialised";
return json.dump();
Expand Down Expand Up @@ -1087,9 +1090,6 @@ std::string OrderList::ToJSONString()
} while ((o = this->GetNext(o)) != this->GetFirstOrder());
}

json["version"] = ORDERLIST_JSON_OUTPUT_VERSION;
json["source"] = std::string(_openttd_revision);

return json.dump(4);

}
Expand Down

0 comments on commit e3af50f

Please sign in to comment.