Skip to content

Commit 71077e6

Browse files
committed
Merge pull request #170 from tangziwen/v3
avoid the case that "hasAmbient" use before assign
2 parents 16ce7ac + da8dc13 commit 71077e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cocos/renderer/CCMeshCommand.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ void MeshCommand::setLightUniforms()
460460
else // normal does not exist
461461
{
462462
Vec3 ambient(0.0f, 0.0f, 0.0f);
463-
bool hasAmbient;
463+
bool hasAmbient = false;
464464
for (const auto& light : lights)
465465
{
466466
if (light->getLightType() == LightType::AMBIENT)

0 commit comments

Comments
 (0)