forked from Mirrorlandia_minetest/minetest
Fixed the problem of <=r548 clients fucking up maps on >=r549 servers. Also, already fucked up maps are now loaded correctly.
This commit is contained in:
parent
2b39be44e4
commit
f706644a50
@ -267,10 +267,10 @@ void MapNode::serialize(u8 *dest, u8 version)
|
|||||||
{
|
{
|
||||||
// In these versions, CONTENT_IGNORE and CONTENT_AIR
|
// In these versions, CONTENT_IGNORE and CONTENT_AIR
|
||||||
// are 255 and 254
|
// are 255 and 254
|
||||||
if(d == CONTENT_IGNORE)
|
if(actual_d == CONTENT_IGNORE)
|
||||||
d = 255;
|
actual_d = 255;
|
||||||
else if(d == CONTENT_AIR)
|
else if(actual_d == CONTENT_AIR)
|
||||||
d = 254;
|
actual_d = 254;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(version == 0)
|
if(version == 0)
|
||||||
@ -317,17 +317,25 @@ void MapNode::deSerialize(u8 *source, u8 version)
|
|||||||
d = source[0];
|
d = source[0];
|
||||||
param = source[1];
|
param = source[1];
|
||||||
param2 = source[2];
|
param2 = source[2];
|
||||||
|
}
|
||||||
// Convert from old version to new
|
|
||||||
if(version <= 18)
|
// Convert from old version to new
|
||||||
{
|
if(version <= 18)
|
||||||
// In these versions, CONTENT_IGNORE and CONTENT_AIR
|
{
|
||||||
// are 255 and 254
|
// In these versions, CONTENT_IGNORE and CONTENT_AIR
|
||||||
if(d == 255)
|
// are 255 and 254
|
||||||
d = CONTENT_IGNORE;
|
if(d == 255)
|
||||||
else if(d == 254)
|
d = CONTENT_IGNORE;
|
||||||
d = CONTENT_AIR;
|
else if(d == 254)
|
||||||
}
|
d = CONTENT_AIR;
|
||||||
|
}
|
||||||
|
// version 19 is fucked up with sometimes the old values and sometimes not
|
||||||
|
if(version == 19)
|
||||||
|
{
|
||||||
|
if(d == 255)
|
||||||
|
d = CONTENT_IGNORE;
|
||||||
|
else if(d == 254)
|
||||||
|
d = CONTENT_AIR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user