Fix libhooktick.js

I've sorted the whole libhooktick mess out,
This commit is contained in:
MollTheCoder 2023-07-07 15:45:36 -04:00 committed by GitHub
parent 2bc317948a
commit 03bf4ba94e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1,14 +1,14 @@
let __registeredTickCallbacks = [];
window.addEventListener("load", ()=>{
let oldTick = tick;
clearInterval(tickInterval);
const oldTick = tick;
tickInterval = setInterval(tick, 1000/tps);
tick = function(){
oldTick();
__registeredTickCallbacks.forEach(func=>{
func();
});
}
tickInterval = setInterval(tick, 1000/tps);
});
function everyTick(callback){
__registeredTickCallbacks.push(callback);