summaryrefslogtreecommitdiff
path: root/src/nodemetadata.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/nodemetadata.cpp')
-rw-r--r--src/nodemetadata.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nodemetadata.cpp b/src/nodemetadata.cpp
index 4cdd61767..0631d974a 100644
--- a/src/nodemetadata.cpp
+++ b/src/nodemetadata.cpp
@@ -130,12 +130,12 @@ void NodeMetadataList::deSerialize(std::istream &is, IGameDef *gamedef)
{
u16 p16 = readU16(is);
- v3s16 p(0,0,0);
- p.Z += p16 / MAP_BLOCKSIZE / MAP_BLOCKSIZE;
- p16 -= p.Z * MAP_BLOCKSIZE * MAP_BLOCKSIZE;
- p.Y += p16 / MAP_BLOCKSIZE;
- p16 -= p.Y * MAP_BLOCKSIZE;
- p.X += p16;
+ v3s16 p;
+ p.Z = p16 / MAP_BLOCKSIZE / MAP_BLOCKSIZE;
+ p16 &= MAP_BLOCKSIZE * MAP_BLOCKSIZE - 1;
+ p.Y = p16 / MAP_BLOCKSIZE;
+ p16 &= MAP_BLOCKSIZE - 1;
+ p.X = p16;
if(m_data.find(p) != m_data.end())
{