1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Fix light and multimesh crashes

This commit is contained in:
clayjohn
2020-01-12 17:45:06 -08:00
parent 269eb5f06c
commit 179193775b
3 changed files with 22 additions and 14 deletions

View File

@@ -1891,13 +1891,13 @@ void RasterizerSceneGLES3::_setup_light(RenderList::Element *e, const Transform
if (li->last_pass != render_pass) //not visible
continue;
if (li->light_ptr->type == VS::LIGHT_OMNI) {
if (li && li->light_ptr->type == VS::LIGHT_OMNI) {
if (omni_count < maxobj && e->instance->layer_mask & li->light_ptr->cull_mask) {
omni_indices[omni_count++] = li->light_index;
}
}
if (li->light_ptr->type == VS::LIGHT_SPOT) {
if (li && li->light_ptr->type == VS::LIGHT_SPOT) {
if (spot_count < maxobj && e->instance->layer_mask & li->light_ptr->cull_mask) {
spot_indices[spot_count++] = li->light_index;
}