From 14fc385adaa50ff6d0f116a309d49131ad9e565f Mon Sep 17 00:00:00 2001 From: RandomityGuy <31925790+RandomityGuy@users.noreply.github.com> Date: Mon, 10 Feb 2025 14:19:02 +0530 Subject: [PATCH] fix this --- src/Marble.hx | 2 ++ src/gui/LeaderboardsGui.hx | 7 +------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Marble.hx b/src/Marble.hx index 3e288ea5..051aaa54 100644 --- a/src/Marble.hx +++ b/src/Marble.hx @@ -658,6 +658,8 @@ class Marble extends GameObject { } function loadMarbleAttributes() { + if (this.level == null || this.level.mission == null) + return; var attribs = this.level.mission.marbleAttributes; if (attribs.exists("maxrollvelocity")) this._maxRollVelocity = MisParser.parseNumber(attribs.get("maxrollvelocity")); diff --git a/src/gui/LeaderboardsGui.hx b/src/gui/LeaderboardsGui.hx index 4e70662e..683a59dd 100644 --- a/src/gui/LeaderboardsGui.hx +++ b/src/gui/LeaderboardsGui.hx @@ -30,12 +30,7 @@ class LeaderboardsGui extends GuiImage { this.position = new Vector(); this.extent = new Vector(640, 480); - #if hl - var scene2d = hxd.Window.getInstance(); - #end - #if js - var scene2d = MarbleGame.instance.scene2d; - #end + var scene2d = MarbleGame.canvas.scene2d; var offsetX = (scene2d.width - 1280) / 2; var offsetY = (scene2d.height - 720) / 2;