1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-07 03:12:36 +01:00

Fix off-by-one error in Simple Model atomic lookup

This commit is contained in:
Daniel Evans 2017-01-09 20:56:49 +00:00
parent 308d1d6deb
commit e1f7d11c82

View File

@ -365,7 +365,7 @@ TextureArchive GameData::loadTextureArchive(const std::string& name) {
void GameData::getNameAndLod(std::string& name, int& lod) { void GameData::getNameAndLod(std::string& name, int& lod) {
auto lodpos = name.rfind("_l"); auto lodpos = name.rfind("_l");
if (lodpos != std::string::npos) { if (lodpos != std::string::npos) {
lod = std::atoi(name.substr(lodpos + 1).c_str()); lod = std::atoi(name.substr(lodpos + 2).c_str());
name = name.substr(0, lodpos); name = name.substr(0, lodpos);
} }
} }