Skip to content

Commit e850ddc

Browse files
authored
Merge pull request phaserjs#3397 from bigbozo/master
Fix [CameraManager].getCamera(<name>)
2 parents 19ea528 + b977f09 commit e850ddc

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/cameras/2d/CameraManager.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,13 +308,13 @@ var CameraManager = new Class({
308308
*/
309309
getCamera: function (name)
310310
{
311-
this.cameras.forEach(function (camera)
311+
for (var i = 0; i < this.cameras.length; i++)
312312
{
313-
if (camera.name === name)
313+
if (this.cameras[i].name === name)
314314
{
315-
return camera;
315+
return this.cameras[i];
316316
}
317-
});
317+
}
318318

319319
return null;
320320
},

src/cameras/sprite3d/CameraManager.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,13 @@ var CameraManager = new Class({
155155
*/
156156
getCamera: function (name)
157157
{
158-
this.cameras.forEach(function (camera)
158+
for (var i = 0; i < this.cameras.length; i++)
159159
{
160-
if (camera.name === name)
160+
if (this.cameras[i].name === name)
161161
{
162-
return camera;
162+
return this.cameras[i];
163163
}
164-
});
164+
}
165165

166166
return null;
167167
},

0 commit comments

Comments
 (0)