summaryrefslogtreecommitdiff
path: root/src/engine/tracks/Track.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/tracks/Track.cpp')
-rw-r--r--src/engine/tracks/Track.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/engine/tracks/Track.cpp b/src/engine/tracks/Track.cpp
index 49fcddabf..8db929986 100644
--- a/src/engine/tracks/Track.cpp
+++ b/src/engine/tracks/Track.cpp
@@ -350,7 +350,6 @@ bool IsTriangleWindingInverted() {
return !gModifiedGfxSet.empty();
}
-
Track::Track() {
Props.SetText(Props.ResourceName, "mod:blank_track", sizeof(Props.ResourceName));
Props.SetText(Props.Name, "Blank Track", sizeof(Props.Name));
@@ -358,7 +357,7 @@ Track::Track() {
Props.SetText(Props.TrackLength, "100m", sizeof(Props.TrackLength));
// Props.Cup = FLOWER_CUP;
// Props.CupIndex = 3;
- ResourceName = "";
+ ResourceName = "mod:blank_track";
Props.Minimap.Texture = minimap_mario_raceway;
Props.Minimap.Width = ResourceGetTexWidthByName(Props.Minimap.Texture);
Props.Minimap.Height = ResourceGetTexHeightByName(Props.Minimap.Texture);
@@ -450,7 +449,7 @@ void Track::Load() {
} else { // Load custom track
bIsMod = true;
- Editor::LoadTrackDataFromJson(this, trackPath);
+ TrackEditor::LoadTrackDataFromJson(this, trackPath);
const std::string trackSectionPath = (trackPath + "/data_track_sections");
TrackSections* sections = (TrackSections*) LOAD_ASSET_RAW(trackSectionPath.c_str());
@@ -647,6 +646,10 @@ void Track::Draw(ScreenContext* arg0) {
}
const TrackInfo* info = gTrackRegistry.GetInfo(ResourceName);
+ if (nullptr == info) {
+ printf("[Track] [Draw] Resource name did not return a valid TrackInfo %s\n", ResourceName.c_str());
+ return;
+ }
std::string res = info->Path + "/data_track_sections";
TrackSections* sections = (TrackSections*) LOAD_ASSET_RAW(res.c_str());