Skip to content

Commit 0524497

Browse files
committed
Update APGameState.hx
1 parent 0b8ea65 commit 0524497

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

source/archipelago/APGameState.hx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ class APGameState {
194194
trace("Constructed songPath: " + songPath);
195195

196196
var songJson:backend.Song.SwagSong = null;
197-
var jsonStuff:Array<String> = Paths.crawlDirectoryOG("mods/" + modName + "/data", ".json");
197+
var jsonStuff:Array<String> = modName.trim() != ""
198+
? Paths.crawlDirectoryOG("mods/" + modName + "/data", ".json")
199+
: Paths.crawlDirectoryOG("assets/shared/data", ".json");
198200
trace("Retrieved JSON files: " + jsonStuff);
199201

200202
for (json in jsonStuff) {
@@ -234,17 +236,16 @@ class APGameState {
234236
public function checkGoal(songName:String, modName:String):Bool {
235237
var info = info();
236238
var locations = locationData(songName + (modName != "" ? " (" + modName + ")" : "")).concat(noteData(songName, modName));
237-
var isGoal:Bool = true;
238239
for (location in locations) {
239240
if (info.missingLocations.contains(location)) {
240-
isGoal = false;
241-
break;
241+
return false;
242242
}
243243
}
244-
if (isGoal) {
244+
if (states.FreeplayState.isVictorySong(songName, modName)) {
245245
setGoal();
246+
return true;
246247
}
247-
return isGoal;
248+
return false;
248249
}
249250

250251
public function setGoal():Void {

0 commit comments

Comments
 (0)