Skip to content

Commit 8174ec2

Browse files
committed
Fixed light distance and max test
1 parent 4d7435f commit 8174ec2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/gameobjects/lights/LightsManager.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ var LightsManager = new Class({
163163
}
164164
}
165165

166-
if (visibleLights > this.maxLights)
166+
if (visibleLights.length > this.maxLights)
167167
{
168168
// We've got too many lights, so sort by distance from camera and cull those far away
169169
// This isn't ideal because it doesn't factor in the radius of the lights, but it'll do for now
@@ -181,7 +181,7 @@ var LightsManager = new Class({
181181

182182
sortByDistance: function (a, b)
183183
{
184-
return (a.distance < b.distance);
184+
return (a.distance >= b.distance);
185185
},
186186

187187
/**

0 commit comments

Comments
 (0)