Fix export CLI argument bounds

This commit is contained in:
dajiaohuang
2026-09-14 01:51:48 +08:00
parent c2cbe095a3
commit 1d482cc0b1
+3 -3
View File
@@ -45,7 +45,7 @@ void args_parse() {
else if (path_is_texture(current_arg)) {
args_asset_path = args_path(current_arg);
}
else if (string_equals(current_arg, "--export-textures") && (i + 3) <= iron_get_arg_count()) {
else if (string_equals(current_arg, "--export-textures") && (i + 3) < iron_get_arg_count()) {
args_export_textures = true;
++i;
args_export_textures_type = string_copy(iron_get_arg(i));
@@ -57,7 +57,7 @@ void args_parse() {
else if (string_equals(current_arg, "--reload-mesh")) {
args_reimport_mesh = true;
}
else if (string_equals(current_arg, "--export-mesh") && (i + 1) <= iron_get_arg_count()) {
else if (string_equals(current_arg, "--export-mesh") && (i + 1) < iron_get_arg_count()) {
args_export_mesh = true;
++i;
args_export_mesh_path = args_path(iron_get_arg(i));
@@ -65,7 +65,7 @@ void args_parse() {
else if (path_is_mesh(current_arg) || iron_is_directory(current_arg)) {
args_asset_path = args_path(current_arg);
}
else if (string_equals(current_arg, "--export-material") && (i + 1) <= iron_get_arg_count()) {
else if (string_equals(current_arg, "--export-material") && (i + 1) < iron_get_arg_count()) {
args_export_material = true;
++i;
args_export_material_path = args_path(iron_get_arg(i));