mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-26 18:21:04 +00:00
Messed around with genmap.py. Now supports format version 17.
This commit is contained in:
parent
f07e445f80
commit
a649d43fe7
5 changed files with 241 additions and 56 deletions
|
@ -223,6 +223,8 @@ FIXME: The new optimized map sending doesn't sometimes send enough blocks
|
|||
|
||||
* Take player's walking direction into account in GetNextBlocks
|
||||
|
||||
TODO: Map saving should be done by EmergeThread
|
||||
|
||||
Environment:
|
||||
------------
|
||||
|
||||
|
|
|
@ -5540,9 +5540,11 @@ void ServerMap::loadBlock(std::string sectordir, std::string blockfile, MapSecto
|
|||
catch(SerializationError &e)
|
||||
{
|
||||
dstream<<"WARNING: Invalid block data on disk "
|
||||
"(SerializationError). Ignoring. "
|
||||
"A new one will be generated."
|
||||
"(SerializationError). "
|
||||
"what()="<<e.what()
|
||||
<<std::endl;
|
||||
//" Ignoring. A new one will be generated.
|
||||
assert(0);
|
||||
|
||||
// TODO: Backup file; name is in fullpath.
|
||||
}
|
||||
|
|
|
@ -2450,7 +2450,8 @@ void MapBlock::deSerialize(std::istream &is, u8 version)
|
|||
std::string s = os.str();
|
||||
if(s.size() != nodecount*3)
|
||||
throw SerializationError
|
||||
("MapBlock::deSerialize: invalid format");
|
||||
("MapBlock::deSerialize: decompress resulted in size"
|
||||
" other than nodecount*3");
|
||||
|
||||
// Set contents
|
||||
for(u32 i=0; i<nodecount; i++)
|
||||
|
|
|
@ -128,7 +128,7 @@ void decompressZlib(std::istream &is, std::ostream &os)
|
|||
|
||||
ret = inflateInit(&z);
|
||||
if(ret != Z_OK)
|
||||
throw SerializationError("compressZlib: inflateInit failed");
|
||||
throw SerializationError("dcompressZlib: inflateInit failed");
|
||||
|
||||
z.avail_in = 0;
|
||||
|
||||
|
@ -162,7 +162,7 @@ void decompressZlib(std::istream &is, std::ostream &os)
|
|||
|| status == Z_MEM_ERROR)
|
||||
{
|
||||
zerr(status);
|
||||
throw SerializationError("compressZlib: inflate failed");
|
||||
throw SerializationError("decompressZlib: inflate failed");
|
||||
}
|
||||
int count = bufsize - z.avail_out;
|
||||
//dstream<<"count="<<count<<std::endl;
|
||||
|
@ -182,7 +182,7 @@ void decompressZlib(std::istream &is, std::ostream &os)
|
|||
{
|
||||
dstream<<"unget #"<<i<<" failed"<<std::endl;
|
||||
dstream<<"fail="<<is.fail()<<" bad="<<is.bad()<<std::endl;
|
||||
throw SerializationError("compressZlib: unget failed");
|
||||
throw SerializationError("decompressZlib: unget failed");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue