priorities production ready (not tested)

This commit is contained in:
altalk23 2024-11-11 22:40:30 +03:00
parent 673317d3cb
commit 6db3084062

View file

@ -161,7 +161,7 @@ namespace geode::modifier {
if (!res) { if (!res) {
return Err(std::move(res).unwrapErr()); return Err(std::move(res).unwrapErr());
} }
res.unwrap()->setPriority(priority); std::move(res).unwrap()->setPriority(priority);
return Ok(); return Ok();
} }
@ -200,8 +200,8 @@ namespace geode::modifier {
for (auto modHook : hooks) { for (auto modHook : hooks) {
if (modHook->getAddress() != hook->getAddress()) continue; if (modHook->getAddress() != hook->getAddress()) continue;
auto priority = hook->getPriority(); auto priority = hook->getPriority();
if (priority < mod->getPriority()) { if (priority < modHook->getPriority()) {
hook->setPriority(mod->getPriority() + 1); hook->setPriority(modHook->getPriority() + 1);
} }
} }
}; };
@ -234,8 +234,8 @@ namespace geode::modifier {
for (auto modHook : hooks) { for (auto modHook : hooks) {
if (modHook->getAddress() != hook->getAddress()) continue; if (modHook->getAddress() != hook->getAddress()) continue;
auto priority = hook->getPriority(); auto priority = hook->getPriority();
if (priority > mod->getPriority()) { if (priority > modHook->getPriority()) {
hook->setPriority(mod->getPriority() - 1); hook->setPriority(modHook->getPriority() - 1);
} }
} }
}; };