1
0
mirror of synced 2024-11-13 18:50:50 +01:00

Fix material removal if not mapped

This commit is contained in:
KillzXGaming 2019-03-29 16:22:49 -04:00
parent 6c676cf410
commit 71f9ea0276

View File

@ -139,7 +139,16 @@ namespace Bfres.Structs
var result = STOptionsDialog.Show("Shapes are mapped to this material. Are you sure you want to remove this? (Will default to first material)",
"Material Delete", MappedNames);
if (result == DialogResult.Yes)
if (result == DialogResult.Yes) {
RemoveMaterial(model, CurrentIndex);
}
}
else {
RemoveMaterial(model, CurrentIndex);
}
}
private void RemoveMaterial(FMDL model, int CurrentIndex)
{
//Adjust all the indices properly based on this current index
foreach (var shape in model.shapes)
@ -154,8 +163,6 @@ namespace Bfres.Structs
model.materials.Remove(Text);
Parent.Nodes.Remove(this);
}
}
}
public FMDL GetParentModel()
{