Skip to content

Commit 611b288

Browse files
committed
Use "emotions" folder if empty, even if it exists
1 parent 6968d4c commit 611b288

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

scripts/Script1/Script1.gml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,16 @@ function parse_char_json(_emotions, _json_file) {
145145
}
146146
}
147147

148+
function directory_nonempty(_path) {
149+
if (!directory_exists(_path)) {
150+
return false;
151+
}
152+
var _file = file_find_first(_path + "/*", fa_none);
153+
var _output = (_file != "");
154+
file_find_close();
155+
return _output;
156+
}
157+
148158
function create_target_button_directories(_emotions, _current_directory) {
149159
var _target_button_directories_created = ds_map_create();
150160
for (var _i = 1; _i <= ds_map_size(_emotions); _i++) {
@@ -153,7 +163,7 @@ function create_target_button_directories(_emotions, _current_directory) {
153163
if (ds_map_exists(_target_button_directories_created, _candidate_target_button_directory)) {
154164
continue;
155165
}
156-
if (directory_exists(_candidate_target_button_directory)) {
166+
if (directory_nonempty(_candidate_target_button_directory)) {
157167
_candidate_target_button_directory += "2";
158168
_emote.target_button_directory += "2";
159169
}

0 commit comments

Comments
 (0)