Skip to content

Commit 437b994

Browse files
committed
Fix null pointer bug
1 parent 541b9df commit 437b994

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

cheats.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@ ig.module("cheats-gui").requires("game.feature.gui.screen.title-screen", "game.f
295295
setProperties(LANG_EXTENSION, this.labels);
296296
},
297297
});
298-
//*/
299298
// END: Lang Extension
300299
function isNewGamePlus() {
301300
// This is the ONLY method in the game that checks for new game plus and returns a boolean...
@@ -678,7 +677,7 @@ ig.module("cheats-gui").requires("game.feature.gui.screen.title-screen", "game.f
678677
init() {
679678
this.parent();
680679
// Get the first button in the second column so we can position our button above it.
681-
const firstButtonHook = this.buttonGroup.elements[1][0].hook;
680+
const firstButtonHook = this.buttonGroup.elements[1].find((value) => value).hook;
682681
this.cheatsButton = new sc.ButtonGui(ig.lang.get("sc.cheats.title"), firstButtonHook.size.x);
683682
this.cheatsButton.setAlign(firstButtonHook.align.x, firstButtonHook.align.y);
684683
this.cheatsButton.setPos(firstButtonHook.pos.x, firstButtonHook.pos.y + 28);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Cheats",
33
"postload": "cheats.js",
4-
"version": "1.3.3",
4+
"version": "1.3.4",
55
"homepage": "https://github.com/ZeikJT/CrossCodeCheats",
66
"description": "This mod adds cheats to CrossCode.",
77
"ccmodDependencies": {

0 commit comments

Comments
 (0)