Created
July 16, 2017 15:41
-
-
Save unixpickle/a5e514b70b37a5969d878cd85130cfbc to your computer and use it in GitHub Desktop.
Find actsBySid in Construct2 Game
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object.keys(cr_getC2Runtime()).filter((x) => { | |
var obj = cr_getC2Runtime()[x]; | |
if ('object' !== typeof obj || !obj) { | |
return false; | |
} | |
var keys = Object.keys(obj); | |
if (keys.length === 0 || keys.some((x) => x.length < 6)) { | |
return false; | |
} | |
var first = obj[keys[0]]; | |
if ('object' !== typeof first) { | |
return false; | |
} | |
var bools = Object.keys(first).filter((key) => 'boolean' === typeof first[key]); | |
if (bools.length > 2) { | |
// Avoid cndsById. | |
return false; | |
} | |
var funcs = Object.keys(first).filter((key) => 'function' === typeof first[key]); | |
if (funcs.length < 2) { | |
return false; | |
} | |
var argLens = funcs.map((key) => first[key].length); | |
if (argLens.indexOf(0) < 0) { | |
return false; | |
} | |
return true; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment