aboutsummaryrefslogtreecommitdiff
path: root/src/gui/guiFormSpecMenu.cpp
diff options
context:
space:
mode:
authorparamat <paramat@users.noreply.github.com>2018-02-21 14:06:53 +0000
committerparamat <mat.gregory@virginmedia.com>2018-02-21 15:53:32 +0000
commit5652edea3be82e4f43f59722b766cff6a229f0f0 (patch)
treee2b33c70fe28640caf56e231151442b409a7faab /src/gui/guiFormSpecMenu.cpp
parentf9ad0619103ceee40e2a7810b971f93d877a63cd (diff)
downloadminetest-5652edea3be82e4f43f59722b766cff6a229f0f0.tar.gz
minetest-5652edea3be82e4f43f59722b766cff6a229f0f0.tar.bz2
minetest-5652edea3be82e4f43f59722b766cff6a229f0f0.zip
Settingtypes.txt: Fix valleys dungeon ymax error
Diffstat (limited to 'src/gui/guiFormSpecMenu.cpp')
0 files changed, 0 insertions, 0 deletions
class="hl kwb">static inline s16 unsigned_to_signed(u16 i, u16 max_positive) { if (i < max_positive) { return i; } else { return i - (max_positive * 2); } } // Modulo of a negative number does not work consistently in C static inline s64 pythonmodulo(s64 i, s16 mod) { if (i >= 0) { return i % mod; } return mod - ((-i) % mod); } s64 Database::getBlockAsInteger(const v3s16 &pos) { return (u64) pos.Z * 0x1000000 + (u64) pos.Y * 0x1000 + (u64) pos.X; } v3s16 Database::getIntegerAsBlock(s64 i) { v3s16 pos; pos.X = unsigned_to_signed(pythonmodulo(i, 4096), 2048); i = (i - pos.X) / 4096; pos.Y = unsigned_to_signed(pythonmodulo(i, 4096), 2048); i = (i - pos.Y) / 4096;