Fixed level loading
This commit is contained in:
@@ -400,6 +400,12 @@ bool DataModelInstance::load(const char* filename, bool clearObjects)
|
|||||||
if (clearObjects)
|
if (clearObjects)
|
||||||
clearLevel();
|
clearLevel();
|
||||||
readXMLFileStream(&levelFile);
|
readXMLFileStream(&levelFile);
|
||||||
|
std::string sfilename = std::string(filename);
|
||||||
|
std::size_t begin = sfilename.rfind('\\') + 1;
|
||||||
|
std::size_t end = sfilename.find(".rbx");
|
||||||
|
std::string hname = sfilename.substr(begin);
|
||||||
|
std::string tname = hname.substr(0, hname.length() - 5);
|
||||||
|
name = tname;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user