Skip to content

Commit

Permalink
Untie map writes and layout suffix conditionals.
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan McQuen <rpcm@linux.com>
  • Loading branch information
ryanpcmcquen committed Aug 23, 2020
1 parent 98c6949 commit e156402
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions source/mechanics.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,12 @@ int write_map_layout(Game* game)
size_t chars_written = fwrite(new_map_str, sizeof(char), new_map_str_length, new_map_layout);
if (chars_written != new_map_str_length) {
SDL_LogError(SDL_LOG_CATEGORY_ERROR, "Only %zu chars written out of: %zu\n", chars_written, new_map_str_length);
}

if (game->editor.layout_file_suffix == MAP_LAYOUT_FILE_LIMIT) {
game->editor.layout_file_suffix = 0;
} else {
if (game->editor.layout_file_suffix == MAP_LAYOUT_FILE_LIMIT) {
game->editor.layout_file_suffix = 0;
} else {
game->editor.layout_file_suffix++;
}
game->editor.layout_file_suffix++;
}

fclose(new_map_layout);
Expand Down

0 comments on commit e156402

Please sign in to comment.