diff --git a/injector.js b/injector.js index c2418d0..ab8cae7 100644 --- a/injector.js +++ b/injector.js @@ -135,6 +135,19 @@ var main;(function(){` ); } ); + + if(globalThis.optimizePi){ + patchedFile = patchedFile.replaceAll( + /3\.1415927410125732 \/ 180/i, + "0.01745" + ); + + patchedFile = patchedFile.replaceAll( + /3\.1415927410125732/i, + "3.14159" + ); + } + const extractInstanceMethodRegex = /^[\t ]*function \S+?_\S+?_\S+?\((\$this)?/gm; // /^[\t ]*function \S+?_\S+?_\S+?\(\$this/gm const extractInstanceMethodFullNameRegex = /function (\S*?)\(/gm; // /function (\S*?)\(\$this/gm @@ -197,6 +210,8 @@ var main;(function(){` ); //Edge cases. sigh //Done: add support for static properties on classes with constructors like this: function nmcg_GuiMainMenu() { + + patchedFile = patchedFile.replaceAll( /function [a-z]+?_([a-zA-Z\$]+?)\(\) \{/gm, (match) => {