int header_version = root_header.version;
/*if(header_version <= 0){
//In otbm version 1 the count variable after splashes/fluidcontainers and stackables
//are saved as attributes instead, this solves alot of problems with items
//that is changed (stackable/charges/fluidcontainer/splash) during an update.
setLastErrorString("This map needs to be upgraded by using the latest map editor version to be able to load correctly.");
return false;
}
*/
if(header_version > 2){
setLastErrorString("Unknown OTBM version detected, please update your server.");
return false;
}
if(root_header.majorVersionItems < 1){
setLastErrorString("This map needs to be upgraded by using the latest map editor version to be able to load correctly.");
return false;
}
if(root_header.majorVersionItems > (unsigned long)Items::dwMajorVersion){
setLastErrorString("The map was saved with a different items.otb version, an upgraded items.otb is required.");
return false;
}
if(root_header.minorVersionItems > (unsigned long)Items::dwMinorVersion){
std::cout << "Warning: [OTBM loader] This map needs an updated items.otb." <<std::endl;
}
if(root_header.minorVersionItems == CLIENT_VERSION_854_BAD){
std::cout << "Warning: [OTBM loader] This map needs uses an incorrect version of items.otb." <<std::endl;
}
std::cout << "Map size: " << root_header.width << "x" << root_header.height << std::endl;
map->mapWidth = root_header.width;
map->mapHeight = root_header.height;
NODE nodeMap = f.getChildNode(root, type);
if(type != OTBM_MAP_DATA){
setLastErrorString("Could not read data node.");
return false;
}
if(!f.getProps(nodeMap, propStream)){
setLastErrorString("Could not read map data attributes.");
return false;
}