@ -351,8 +351,9 @@ namespace MWWorld
assert ( plugin < mStatic . size ( ) ) ;
assert ( plugin < mStatic . size ( ) ) ;
const LandTextureList & ltexl = mStatic [ plugin ] ;
const LandTextureList & ltexl = mStatic [ plugin ] ;
assert ( index < ltexl . size ( ) ) ;
if ( index > = ltexl . size ( ) )
return & ltexl . at ( index ) ;
return NULL ;
return & ltexl [ index ] ;
}
}
const ESM : : LandTexture * Store < ESM : : LandTexture > : : find ( size_t index , size_t plugin ) const
const ESM : : LandTexture * Store < ESM : : LandTexture > : : find ( size_t index , size_t plugin ) const
{
{
@ -380,10 +381,8 @@ namespace MWWorld
lt . load ( esm , isDeleted ) ;
lt . load ( esm , isDeleted ) ;
// Make sure we have room for the structure
assert ( plugin < mStatic . size ( ) ) ;
if ( plugin > = mStatic . size ( ) ) {
mStatic . resize ( plugin + 1 ) ;
}
LandTextureList & ltexl = mStatic [ plugin ] ;
LandTextureList & ltexl = mStatic [ plugin ] ;
if ( lt . mIndex + 1 > ( int ) ltexl . size ( ) )
if ( lt . mIndex + 1 > ( int ) ltexl . size ( ) )
ltexl . resize ( lt . mIndex + 1 ) ;
ltexl . resize ( lt . mIndex + 1 ) ;
@ -407,6 +406,11 @@ namespace MWWorld
assert ( plugin < mStatic . size ( ) ) ;
assert ( plugin < mStatic . size ( ) ) ;
return mStatic [ plugin ] . end ( ) ;
return mStatic [ plugin ] . end ( ) ;
}
}
void Store < ESM : : LandTexture > : : resize ( size_t num )
{
if ( mStatic . size ( ) < num )
mStatic . resize ( num ) ;
}
// Land
// Land
//=========================================================================
//=========================================================================