Skip to content

Commit

Permalink
idk what about this
Browse files Browse the repository at this point in the history
  • Loading branch information
Joalor64GH authored Sep 19, 2024
1 parent a9c32b4 commit ebeabf9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions source/game/Hscript.hx
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,7 @@ class Hscript extends FlxBasic {

public function execute(file:String, ?executeCreate:Bool = true):Void {
try {
if (Assets.exists(file, TEXT))
interp.execute(parser.parseString(Assets.getText(file)));
else
throw 'script $file doesn\'t exist!';
interp.execute(parser.parseString(file));
} catch (e:Dynamic)
Lib.application.window.alert(e, 'Hscript Error!');

Expand Down
8 changes: 4 additions & 4 deletions source/states/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ class PlayState extends ExtendableState {
foldersToCheck.push('mods/' + mod + '/scripts/');
#end
for (folder in foldersToCheck) {
if (FileSystem.exists(folder)) {
if (FileSystem.exists(folder) && FileSystem.isDirectory(folder)) {
for (file in FileSystem.readDirectory(folder)) {
if (file.endsWith('.hxs')) {
scriptArray.push(new Hscript(folder + file));
scriptArray.push(new Hscript(File.getContent(folder + file)));
}
}
}
Expand Down Expand Up @@ -173,10 +173,10 @@ class PlayState extends ExtendableState {
foldersToCheck.push('mods/' + mod + '/songs/' + Paths.formatToSongPath(song.song) + '/');
#end
for (folder in foldersToCheck) {
if (FileSystem.exists(folder)) {
if (FileSystem.exists(folder) && FileSystem.isDirectory(folder)) {
for (file in FileSystem.readDirectory(folder)) {
if (file.endsWith('.hxs')) {
scriptArray.push(new Hscript(folder + file));
scriptArray.push(new Hscript(File.getContent(folder + file)));
}
}
}
Expand Down

0 comments on commit ebeabf9

Please sign in to comment.