- u8 buf[6];
-
- is.read((char*)buf, 2);
- u16 count = readU16(buf);
-
- for(u16 i=0; i<count; i++)
- {
- is.read((char*)buf, 2);
- u16 p16 = readU16(buf);
-
- 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;
-
- if(m_data.find(p))
- {
- dstream<<"ERROR: NodeMetadataList::deSerialize(): "
- <<"already set data at position"
- <<"("<<p.X<<","<<p.Y<<","<<p.Z<<")"
- <<std::endl;
- throw SerializationError("NodeMetadataList::deSerialize()");
+ for (u16 i = 0; i < count; i++) {
+ v3s16 p;
+ if (absolute_pos) {
+ p.X = readS16(is);
+ p.Y = readS16(is);
+ p.Z = readS16(is);
+ } else {
+ u16 p16 = readU16(is);
+ p.X = p16 & (MAP_BLOCKSIZE - 1);
+ p16 /= MAP_BLOCKSIZE;
+ p.Y = p16 & (MAP_BLOCKSIZE - 1);
+ p16 /= MAP_BLOCKSIZE;
+ p.Z = p16;
+ }
+ if (m_data.find(p) != m_data.end()) {
+ warningstream << "NodeMetadataList::deSerialize(): "
+ << "already set data at position " << PP(p)
+ << ": Ignoring." << std::endl;
+ continue;