1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Quick fix to incorrect error messages when writing to compressed or encrypted files.

This commit is contained in:
Andy Savage
2020-12-15 17:00:39 +00:00
parent 6ccc6b6e28
commit c65f097ebd
2 changed files with 5 additions and 5 deletions

View File

@@ -256,7 +256,7 @@ Error FileAccessEncrypted::get_error() const {
}
void FileAccessEncrypted::store_buffer(const uint8_t *p_src, int p_length) {
ERR_FAIL_COND_MSG(!writing, "File has not been opened in read mode.");
ERR_FAIL_COND_MSG(!writing, "File has not been opened in write mode.");
if (pos < data.size()) {
for (int i = 0; i < p_length; i++) {
@@ -272,13 +272,13 @@ void FileAccessEncrypted::store_buffer(const uint8_t *p_src, int p_length) {
}
void FileAccessEncrypted::flush() {
ERR_FAIL_COND_MSG(!writing, "File has not been opened in read mode.");
ERR_FAIL_COND_MSG(!writing, "File has not been opened in write mode.");
// encrypted files keep data in memory till close()
}
void FileAccessEncrypted::store_8(uint8_t p_dest) {
ERR_FAIL_COND_MSG(!writing, "File has not been opened in read mode.");
ERR_FAIL_COND_MSG(!writing, "File has not been opened in write mode.");
if (pos < data.size()) {
data.write[pos] = p_dest;