Skip to content

Commit

Permalink
Small code fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
crudelios committed Sep 14, 2024
1 parent 60ec1ba commit c405978
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/scenario/message_media_text_blob.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ void message_media_text_blob_save_state(buffer *blob_buffer, buffer *meta_buffer
array_size,
struct_size);

buffer_write_raw(blob_buffer, message_media_text_blob.text_blob, array_size);
if (array_size) {
buffer_write_raw(blob_buffer, message_media_text_blob.text_blob, array_size);
}

array_size = message_media_text_blob.entry_count;
struct_size = (3 * sizeof(int32_t));
Expand Down
2 changes: 1 addition & 1 deletion src/scenario/request.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ void scenario_request_load_state_old_version(buffer *list, int state_version, re
log_error("Error creating requests array. The game will probably crash.", 0, 0);
}
for (size_t i = 0; i < MAX_ORIGINAL_REQUESTS; i++) {
request = array_advance(requests);
array_advance(requests);
}
array_foreach(requests, request) {
request->year = buffer_read_i16(list);
Expand Down

0 comments on commit c405978

Please sign in to comment.