diff options
author | Elias Fleckenstein <54945686+EliasFleckenstein03@users.noreply.github.com> | 2020-11-04 16:44:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-04 16:44:42 +0100 |
commit | 5d9ae5a91c544fc7fbd475decf47cef7e09ef8fc (patch) | |
tree | c980d614fec4a5495798be3e79e033229062c3cd /src/database/database.cpp | |
parent | 28f6a79706b088c37268a59d90878220dc4ef9c7 (diff) | |
parent | 3af10766fd2b58b068e970266724d7eb10e9316b (diff) | |
download | dragonfireclient-5d9ae5a91c544fc7fbd475decf47cef7e09ef8fc.tar.xz |
Merge branch 'master' into master
Diffstat (limited to 'src/database/database.cpp')
-rw-r--r-- | src/database/database.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/database/database.cpp b/src/database/database.cpp index 12e0e1a0f..01cb2b5fc 100644 --- a/src/database/database.cpp +++ b/src/database/database.cpp @@ -20,7 +20,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "database.h" #include "irrlichttypes.h" - /**************** * Black magic! * **************** @@ -37,7 +36,6 @@ static inline s16 unsigned_to_signed(u16 i, u16 max_positive) return i - (max_positive * 2); } - // Modulo of a negative number does not work consistently in C static inline s64 pythonmodulo(s64 i, s16 mod) { @@ -47,15 +45,11 @@ static inline s64 pythonmodulo(s64 i, s16 mod) return mod - ((-i) % mod); } - s64 MapDatabase::getBlockAsInteger(const v3s16 &pos) { - return (u64) pos.Z * 0x1000000 + - (u64) pos.Y * 0x1000 + - (u64) pos.X; + return (u64)pos.Z * 0x1000000 + (u64)pos.Y * 0x1000 + (u64)pos.X; } - v3s16 MapDatabase::getIntegerAsBlock(s64 i) { v3s16 pos; @@ -66,4 +60,3 @@ v3s16 MapDatabase::getIntegerAsBlock(s64 i) pos.Z = unsigned_to_signed(pythonmodulo(i, 4096), 2048); return pos; } - |