mirror of
https://github.com/dhewm/dhewm3.git
synced 2024-11-23 04:51:56 +00:00
Fix loading .ASE models with no materials
The "A Place of Malice" custom map has such a model which caused a crash (models/z13sp2/temple/pushable_collision_box.ASE), see #382
This commit is contained in:
parent
227fe5fc92
commit
0b28322500
1 changed files with 2 additions and 2 deletions
|
@ -814,8 +814,8 @@ bool idRenderModelStatic::ConvertASEToModelSurfaces( const struct aseModel_s *as
|
|||
for ( objectNum = 0 ; objectNum < ase->objects.Num() ; objectNum++ ) {
|
||||
object = ase->objects[objectNum];
|
||||
mesh = &object->mesh;
|
||||
material = ase->materials[object->materialRef];
|
||||
im1 = declManager->FindMaterial( material->name );
|
||||
material = (ase->materials.Num() > object->materialRef) ? ase->materials[object->materialRef] : NULL;
|
||||
im1 = declManager->FindMaterial( material ? material->name : NULL );
|
||||
|
||||
bool normalsParsed = mesh->normalsParsed;
|
||||
|
||||
|
|
Loading…
Reference in a new issue