From e2523a3d8d036a41e4509fa7fedab0c7f7ceb54e Mon Sep 17 00:00:00 2001 From: Jeroen D Stout Date: Tue, 3 Oct 2017 20:19:20 +0200 Subject: [PATCH] Make sprite export start at 0 to correspond with in-game sprite id --- src/openrct2/cmdline_sprite.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/openrct2/cmdline_sprite.c b/src/openrct2/cmdline_sprite.c index 3515ec07d3..42d3a9d3ba 100644 --- a/src/openrct2/cmdline_sprite.c +++ b/src/openrct2/cmdline_sprite.c @@ -575,25 +575,28 @@ sint32 cmdline_for_sprite(const char **argv, sint32 argc) for (sint32 spriteIndex = 0; spriteIndex < maxIndex; spriteIndex++){ - if (spriteIndex % 100 == 99){ + if (spriteIndex % 100 == 99) + { // Status indicator printf("\r%d / %d, %d%%", spriteIndex, maxIndex, spriteIndex / maxIndex); } + if (!sprite_file_export(spriteIndex, outputPath)) + { + fprintf(stderr, "Could not export\n"); + sprite_file_close(); + return -1; + } + // Add to the index at the end of the file name char *counter = outputPath + pathLen + numbers - 1; (*counter)++; - while (*counter > '9'){ + while (*counter > '9') + { *counter = '0'; counter--; (*counter)++; } - - if (!sprite_file_export(spriteIndex, outputPath)) { - fprintf(stderr, "Could not export\n"); - sprite_file_close(); - return -1; - } } sprite_file_close();