Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit d10d262

Browse files
committed
Fix Vector floored ints.
Previously they rounded towards 0, now they'll round towards negative infinity.
1 parent 6c78b19 commit d10d262

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

System/Vector.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,13 +292,13 @@ namespace RTE {
292292
/// Returns the greatest integer that is not greater than the X value of this Vector.
293293
/// </summary>
294294
/// <returns>An int value that represents the X value of this Vector.</returns>
295-
int GetFloorIntX() const { return static_cast<int>(m_X); }
295+
int GetFloorIntX() const { return static_cast<int>(std::floor(m_X)); }
296296

297297
/// <summary>
298298
/// Returns the greatest integer that is not greater than the Y value of this Vector.
299299
/// </summary>
300300
/// <returns>An int value that represents the Y value of this Vector.</returns>
301-
int GetFloorIntY() const { return static_cast<int>(m_Y); }
301+
int GetFloorIntY() const { return static_cast<int>(std::floor(m_Y)); }
302302

303303
/// <summary>
304304
/// Returns a ceilinged copy of this Vector. Does not alter this Vector.

0 commit comments

Comments
 (0)