Fix "disableGamepadDisconnectedScreen" patch

This commit is contained in:
redphx
2025-05-29 20:51:30 +07:00
parent c2f9f129d0
commit e276d9a2b9
3 changed files with 10 additions and 5 deletions

View File

@@ -237,8 +237,12 @@ logFunc(logTag, '//', logMessage);
return false;
}
const constIndex = str.indexOf('const', index - 30);
str = str.substring(0, constIndex) + 'e.onClose();return null;' + str.substring(constIndex);
const constIndex = PatcherUtils.lastIndexOf(str, 'const[', index, 100);
if (constIndex < 0) {
return false;
}
str = PatcherUtils.insertAt(str, constIndex, 'e();return null;');
return str;
},