add pack 'target-version' property

This commit is contained in:
MihailRis 2026-09-28 01:33:27 +03:00
parent df057507e9
commit a5a6e0b43c
2 changed files with 3 additions and 0 deletions

View file

@ -160,6 +160,7 @@ ContentPack ContentPack::read(const io::path& folder) {
checkContentPackId(pack.id, folder);
root.at("title").get(pack.title);
root.at("version").get(pack.version);
root.at("target-version").get(pack.targetVersion);
if (root.has("creators")) {
const auto& creators = root["creators"];
for (int i = 0; i < creators.size(); i++) {

View file

@ -1,5 +1,6 @@
#pragma once
#include "constants.hpp"
#include "typedefs.hpp"
#include "content_fwd.hpp"
#include "io/io.hpp"
@ -72,6 +73,7 @@ struct ContentPack {
io::path folder;
std::vector<DependencyPack> dependencies;
std::string source = "";
std::string targetVersion = ">=" + std::string(ENGINE_VERSION_STRING);
io::path getContentFile() const;