Fix get_model_volume always returning nullptr;
This commit is contained in:
parent
ec0a3658b0
commit
4bb92e9c51
@ -7100,12 +7100,10 @@ const ModelVolume *get_model_volume(const GLVolume &v, const Model &model)
|
|||||||
{
|
{
|
||||||
const ModelVolume * ret = nullptr;
|
const ModelVolume * ret = nullptr;
|
||||||
|
|
||||||
if (model.objects.size() < v.object_idx()) {
|
if (v.object_idx() < model.objects.size()) {
|
||||||
if (v.object_idx() < model.objects.size()) {
|
const ModelObject *obj = model.objects[v.object_idx()];
|
||||||
const ModelObject *obj = model.objects[v.object_idx()];
|
if (v.volume_idx() < obj->volumes.size()) {
|
||||||
if (v.volume_idx() < obj->volumes.size()) {
|
ret = obj->volumes[v.volume_idx()];
|
||||||
ret = obj->volumes[v.volume_idx()];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user