mirror of
https://github.com/geode-sdk/geode.git
synced 2025-04-04 01:01:00 -04:00
fix supersede ids being validated
This commit is contained in:
parent
a299f86170
commit
754ae3cde6
1 changed files with 11 additions and 2 deletions
|
@ -327,10 +327,19 @@ Result<ServerModVersion> ServerModVersion::parse(matjson::Value const& raw) {
|
|||
auto obj = incompat.obj();
|
||||
|
||||
ModMetadata::Incompatibility incompatibility;
|
||||
obj.needs("mod_id").validate(MiniFunction<bool(std::string const&)>(&ModMetadata::validateID)).into(incompatibility.id);
|
||||
obj.needs("version").into(incompatibility.version);
|
||||
obj.has("importance").into(incompatibility.importance);
|
||||
|
||||
auto modIdValue = obj.needs("mod_id");
|
||||
|
||||
// Do not validate if we have a supersede, maybe the old ID is invalid
|
||||
if (incompatibility.importance == ModMetadata::Incompatibility::Importance::Superseded) {
|
||||
modIdValue.into(incompatibility.id);
|
||||
} else {
|
||||
modIdValue.validate(MiniFunction<bool(std::string const&)>(&ModMetadata::validateID)).into(incompatibility.id);
|
||||
}
|
||||
|
||||
obj.needs("version").into(incompatibility.version);
|
||||
|
||||
// Check if this incompatability is installed, and if so assign the `mod` member to mark that
|
||||
auto mod = Loader::get()->getInstalledMod(incompatibility.id);
|
||||
if (mod && incompatibility.version.compare(mod->getVersion())) {
|
||||
|
|
Loading…
Add table
Reference in a new issue