Skip to content

Commit 490af72

Browse files
committed
Merge pull request #109815 from Muller-Castro/export-script-file
Fix `EditorExportPlugin::_export_file()` ignoring GDScripts
2 parents 853884b + 9504b0f commit 490af72

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

editor/export/editor_export_platform.cpp

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,6 +1349,8 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &
13491349
}
13501350

13511351
bool do_export = true;
1352+
bool skip_all = false;
1353+
int skipped_i = export_plugins.size() - 1;
13521354
for (int i = 0; i < export_plugins.size(); i++) {
13531355
if (GDVIRTUAL_IS_OVERRIDDEN_PTR(export_plugins[i], _export_file)) {
13541356
export_plugins.write[i]->_export_file_script(path, type, features_psa);
@@ -1364,26 +1366,30 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &
13641366
}
13651367
}
13661368

1367-
for (int j = 0; j < export_plugins[i]->extra_files.size(); j++) {
1368-
err = save_proxy.save_file(p_udata, export_plugins[i]->extra_files[j].path, export_plugins[i]->extra_files[j].data, idx, total, enc_in_filters, enc_ex_filters, key, seed);
1369-
if (err != OK) {
1370-
return err;
1371-
}
1372-
if (export_plugins[i]->extra_files[j].remap) {
1373-
do_export = false; // If remap, do not.
1374-
path_remaps.push_back(path);
1375-
path_remaps.push_back(export_plugins[i]->extra_files[j].path);
1376-
}
1377-
}
1378-
13791369
if (export_plugins[i]->skipped) {
13801370
do_export = false;
1371+
skip_all = true;
1372+
skipped_i = i;
1373+
break;
13811374
}
1382-
export_plugins.write[i]->_clear();
1375+
}
13831376

1384-
if (!do_export) {
1385-
break;
1377+
for (int i = 0; i <= skipped_i; i++) {
1378+
if (!skip_all) {
1379+
for (const EditorExportPlugin::ExtraFile &extra_file : export_plugins[i]->extra_files) {
1380+
err = save_proxy.save_file(p_udata, extra_file.path, extra_file.data, idx, total, enc_in_filters, enc_ex_filters, key, seed);
1381+
if (err != OK) {
1382+
return err;
1383+
}
1384+
if (extra_file.remap) {
1385+
do_export = false; // If remap, do not.
1386+
path_remaps.push_back(path);
1387+
path_remaps.push_back(extra_file.path);
1388+
}
1389+
}
13861390
}
1391+
1392+
export_plugins.write[i]->_clear();
13871393
}
13881394
if (!do_export) {
13891395
continue;

0 commit comments

Comments
 (0)