1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-31 02:19:09 +00:00

Fix #12718: Inverted condition prevented actually writing data to files.

This commit is contained in:
2024-09-16 14:17:31 +01:00
parent 908ee7292b
commit 5e78dd8a3f

View File

@@ -2261,7 +2261,7 @@ struct FileWriter : SaveFilter {
void Write(uint8_t *buf, size_t size) override
{
/* We're in the process of shutting down, i.e. in "failure" mode. */
if (this->file.has_value()) return;
if (!this->file.has_value()) return;
if (fwrite(buf, 1, size, *this->file) != size) SlError(STR_GAME_SAVELOAD_ERROR_FILE_NOT_WRITEABLE);
}