fix target gd version not working if it's set to *

This commit is contained in:
HJfod 2024-08-20 12:57:04 +03:00
parent 07001bf36f
commit 71eb4a2041

View file

@ -133,7 +133,7 @@ Result<ModMetadata> ModMetadata::Impl::createFromSchemaV010(ModJson const& rawJs
// change all of this to the gd.needs(...) stuff
gd.assertIs({ matjson::Type::Object, matjson::Type::String });
if (gd.isObject()) {
gd.needs(GEODE_PLATFORM_SHORT_IDENTIFIER)
gd.needs(GEODE_PLATFORM_SHORT_IDENTIFIER_NOARCH)
.mustBe<std::string>("a valid gd version", [](auto const& str) {
return str == "*" || numFromString<double>(str).isOk();
})
@ -544,7 +544,7 @@ VersionInfo ModMetadata::getGeodeVersion() const {
return m_impl->m_geodeVersion;
}
Result<> ModMetadata::checkGameVersion() const {
if (!m_impl->m_gdVersion.empty()) {
if (!m_impl->m_gdVersion.empty() && m_impl->m_gdVersion != "*") {
auto const ver = m_impl->m_gdVersion;
auto res = numFromString<double>(ver);