mirror of
https://github.com/eaglerforge/EaglerForgeInjector
synced 2025-07-25 07:01:20 -09:00
fix prototype injection again
This commit is contained in:
parent
e38fd7c111
commit
91e6ca6d8c
@ -396,9 +396,14 @@ globalThis.modapi_postinit = "(" + (() => {
|
|||||||
|
|
||||||
//Prototype Injection, allows for far easier access to methods
|
//Prototype Injection, allows for far easier access to methods
|
||||||
if (typeof item === "function" && ModAPI.hooks._rippedMethodTypeMap[method] === "instance") {
|
if (typeof item === "function" && ModAPI.hooks._rippedMethodTypeMap[method] === "instance") {
|
||||||
item.prototype["$" + method.replace(compiledName + "_", "")] = function (...args) {
|
var prototypeInjectedMethod = function prototypeInjectedMethod(...args) {
|
||||||
return ModAPI.hooks.methods[method].apply(this, [this, ...args]);
|
return ModAPI.hooks.methods[method].apply(this, [this, ...args]);
|
||||||
}
|
}
|
||||||
|
if ((item.prototype["$" + method.replace(compiledName + "_", "")]?.name ?? "prototypeInjectedMethod") === "prototypeInjectedMethod") {
|
||||||
|
item.prototype["$" + method.replace(compiledName + "_", "")] = prototypeInjectedMethod;
|
||||||
|
} else {
|
||||||
|
item.prototype["$" + method.replace(compiledName + "_", "")] ||= prototypeInjectedMethod;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user