diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index cf06f63288..f7604cd08c 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -1955,6 +1955,8 @@ determine_effective_texture() { _effective_tex_gen = DCAST(TexGenAttrib, _effective_tex_gen->add_stage (stage, TexGenAttrib::M_constant, TexCoord3f(_current_color_scale[3], 0.0f, 0.0f))); } + + nassertv(_effective_texture->get_num_on_stages() <= _max_texture_stages); } ////////////////////////////////////////////////////////////////////