This commit is contained in:
dank_meme 2024-06-08 07:48:05 +02:00
commit ebf55395f5
2 changed files with 12 additions and 3 deletions
CHANGELOG.md
loader/src/server

View file

@ -22,7 +22,7 @@
* Make `queueInMainThread` take in a movable callback (0c35a92)
* Add `CCMenuItemExt` for lambda versions of CCMenuItem classes (de73317)
* Add `scrollToTop` for ScrollLayer (7071bb1)
* Add a new `Task` class for generic task implementations
* Add a new `Task` class for generic asynchronous task implementations
* Documentation can be found [here](https://docs.geode-sdk.org/tutorials/tasks/)
* Add a special task named `WebTask` for handling web requests
* Fix `Unzip` crash on missing progress callback (1145426)

View file

@ -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())) {