mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 16:20:11 -04:00
display: fix crash with oversized p3d_LightSource array
This was a regression in 89f1a0e63c Closes #897
This commit is contained in:
parent
94571aac93
commit
088a1f3774
@ -1656,6 +1656,7 @@ fetch_specified_member(const NodePath &np, CPT_InternalName attrib, LMatrix4 &t)
|
|||||||
if (attrib == IN_color) {
|
if (attrib == IN_color) {
|
||||||
if (node == nullptr) {
|
if (node == nullptr) {
|
||||||
t = LMatrix4::ident_mat();
|
t = LMatrix4::ident_mat();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
Light *light = node->as_light();
|
Light *light = node->as_light();
|
||||||
nassertv(light != nullptr);
|
nassertv(light != nullptr);
|
||||||
@ -1665,6 +1666,7 @@ fetch_specified_member(const NodePath &np, CPT_InternalName attrib, LMatrix4 &t)
|
|||||||
} else if (attrib == IN_ambient) {
|
} else if (attrib == IN_ambient) {
|
||||||
if (node == nullptr) {
|
if (node == nullptr) {
|
||||||
t = LMatrix4::ident_mat();
|
t = LMatrix4::ident_mat();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
Light *light = node->as_light();
|
Light *light = node->as_light();
|
||||||
nassertv(light != nullptr);
|
nassertv(light != nullptr);
|
||||||
@ -1679,6 +1681,7 @@ fetch_specified_member(const NodePath &np, CPT_InternalName attrib, LMatrix4 &t)
|
|||||||
} else if (attrib == IN_diffuse) {
|
} else if (attrib == IN_diffuse) {
|
||||||
if (node == nullptr) {
|
if (node == nullptr) {
|
||||||
t = LMatrix4::ident_mat();
|
t = LMatrix4::ident_mat();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
Light *light = node->as_light();
|
Light *light = node->as_light();
|
||||||
nassertv(light != nullptr);
|
nassertv(light != nullptr);
|
||||||
@ -1693,6 +1696,7 @@ fetch_specified_member(const NodePath &np, CPT_InternalName attrib, LMatrix4 &t)
|
|||||||
} else if (attrib == IN_specular) {
|
} else if (attrib == IN_specular) {
|
||||||
if (node == nullptr) {
|
if (node == nullptr) {
|
||||||
t = LMatrix4::ident_mat();
|
t = LMatrix4::ident_mat();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
Light *light = node->as_light();
|
Light *light = node->as_light();
|
||||||
nassertv(light != nullptr);
|
nassertv(light != nullptr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user