you cant use getMod in a source file, silly

This commit is contained in:
camila314 2024-03-11 20:15:55 -05:00
parent 96fee44064
commit c02dc7d08b
2 changed files with 6 additions and 8 deletions
loader
include/Geode/loader
src/loader

View file

@ -2,6 +2,7 @@
#include "Event.hpp"
#include "Loader.hpp"
#include "Mod.hpp"
#include <matjson.hpp>
namespace geode::ipc {
@ -64,5 +65,9 @@ namespace geode::ipc {
IPCFilter(IPCFilter const&) = default;
};
std::monostate listen(std::string const& messageID, matjson::Value(*callback)(IPCEvent*));
inline void listen(std::string const& messageID, matjson::Value(*callback)(IPCEvent*)) {
(void) new EventListener(
callback, IPCFilter(getMod()->getID(), messageID)
);
}
}

View file

@ -5,13 +5,6 @@
using namespace geode::prelude;
std::monostate ipc::listen(std::string const& messageID, matjson::Value(*callback)(IPCEvent*)) {
(void) new EventListener(
callback, IPCFilter(getMod()->getID(), messageID)
);
return std::monostate();
}
ipc::IPCEvent::IPCEvent(
void* rawPipeHandle,
std::string const& targetModID,