mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-12-15 11:11:51 +00:00
Fix runBeforeMethod and runAfterMethod
This commit is contained in:
parent
1c585986d2
commit
66f085250a
@ -424,8 +424,8 @@ export class ModInterface {
|
|||||||
const oldHandle = classHandle.prototype[methodName];
|
const oldHandle = classHandle.prototype[methodName];
|
||||||
classHandle.prototype[methodName] = function () {
|
classHandle.prototype[methodName] = function () {
|
||||||
//@ts-ignore Same as above
|
//@ts-ignore Same as above
|
||||||
executeBefore.apply(this, ...arguments);
|
executeBefore.apply(this, arguments);
|
||||||
return oldHandle.apply(this, ...arguments);
|
return oldHandle.apply(this, arguments);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -442,9 +442,9 @@ export class ModInterface {
|
|||||||
runAfterMethod(classHandle, methodName, executeAfter) {
|
runAfterMethod(classHandle, methodName, executeAfter) {
|
||||||
const oldHandle = classHandle.prototype[methodName];
|
const oldHandle = classHandle.prototype[methodName];
|
||||||
classHandle.prototype[methodName] = function () {
|
classHandle.prototype[methodName] = function () {
|
||||||
const returnValue = oldHandle.apply(this, ...arguments);
|
const returnValue = oldHandle.apply(this, arguments);
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
executeAfter.apply(this, ...arguments);
|
executeAfter.apply(this, arguments);
|
||||||
return returnValue;
|
return returnValue;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user