diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/file_sys/vfs_real.cpp | 3 | ||||
-rw-r--r-- | src/input_common/drivers/mouse.cpp | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/core/file_sys/vfs_real.cpp b/src/core/file_sys/vfs_real.cpp index b0515ec05..1c706e4d8 100644 --- a/src/core/file_sys/vfs_real.cpp +++ b/src/core/file_sys/vfs_real.cpp @@ -283,7 +283,8 @@ std::size_t RealVfsFile::GetSize() const { if (size) { return *size; } - return FS::GetSize(path); + auto lk = base.RefreshReference(path, perms, *reference); + return reference->file ? reference->file->GetSize() : 0; } bool RealVfsFile::Resize(std::size_t new_size) { diff --git a/src/input_common/drivers/mouse.cpp b/src/input_common/drivers/mouse.cpp index dac29c78f..9fb824baf 100644 --- a/src/input_common/drivers/mouse.cpp +++ b/src/input_common/drivers/mouse.cpp @@ -160,8 +160,9 @@ void Mouse::Move(int x, int y, int center_x, int center_y) { last_mouse_change.y += mouse_change.y * y_sensitivity; // Bind the mouse change to [0 <= deadzone_counterweight <= 1.0] - if (last_mouse_change.Length() < deadzone_counterweight) { - last_mouse_change /= last_mouse_change.Length(); + const float length = last_mouse_change.Length(); + if (length < deadzone_counterweight && length != 0.0f) { + last_mouse_change /= length; last_mouse_change *= deadzone_counterweight; } |