Skip to content

Commit 6369818

Browse files
committed
Merge branch 'Archipelago' of https://github.com/Z11Coding/Mixtape-Engine-Rework into Archipelago
2 parents 28ee992 + 0524497 commit 6369818

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
@@ -198,7 +198,9 @@ class APGameState {
198198
trace("Constructed songPath: " + songPath);
199199

200200
var songJson:backend.Song.SwagSong = null;
201-
var jsonStuff:Array<String> = Paths.crawlDirectoryOG("mods/" + modName + "/data", ".json");
201+
var jsonStuff:Array<String> = modName.trim() != ""
202+
? Paths.crawlDirectoryOG("mods/" + modName + "/data", ".json")
203+
: Paths.crawlDirectoryOG("assets/shared/data", ".json");
202204
trace("Retrieved JSON files: " + jsonStuff);
203205

204206
for (json in jsonStuff) {
@@ -238,17 +240,16 @@ class APGameState {
238240
public function checkGoal(songName:String, modName:String):Bool {
239241
var info = info();
240242
var locations = locationData(songName + (modName != "" ? " (" + modName + ")" : "")).concat(noteData(songName, modName));
241-
var isGoal:Bool = true;
242243
for (location in locations) {
243244
if (info.missingLocations.contains(location)) {
244-
isGoal = false;
245-
break;
245+
return false;
246246
}
247247
}
248-
if (isGoal) {
248+
if (states.FreeplayState.isVictorySong(songName, modName)) {
249249
setGoal();
250+
return true;
250251
}
251-
return isGoal;
252+
return false;
252253
}
253254

254255
public function setGoal():Void {

0 commit comments

Comments
 (0)