1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-25 20:02:40 +01:00

Avoid error in substr if short modelname in LOD selection

This commit is contained in:
Jannik Vogel 2016-08-08 06:39:08 +02:00
parent f7fca167dc
commit f82beeefac

View File

@ -147,7 +147,7 @@ bool GameWorld::placeItems(const std::string& name)
for(auto& p: instancePool.objects) {
auto object = p.second;
InstanceObject* instance = static_cast<InstanceObject*>(object);
if( !instance->object->LOD ) {
if( !instance->object->LOD && instance->object->modelName.length() > 3) {
auto lodInstit = modelInstances.find("LOD" + instance->object->modelName.substr(3));
if( lodInstit != modelInstances.end() ) {
instance->LODinstance = lodInstit->second;