Doing one final commit before the task of merging physics with core.

This commit is contained in:
Richard Davey
2013-06-25 15:35:45 +01:00
parent ec845155eb
commit 0591c7f2bd
12 changed files with 659 additions and 682 deletions
+5 -1
View File
@@ -527,6 +527,8 @@ module Phaser {
*/
public remove(object, splice: bool = false) {
console.log('removing from group');
this._i = this.members.indexOf(object);
if (this._i < 0 || (this._i >= this.members.length))
@@ -544,6 +546,8 @@ module Phaser {
this.members[this._i] = null;
}
console.log('nulled');
if (object['events'])
{
object['events'].onRemovedFromGroup.dispatch(object, this);
@@ -615,7 +619,7 @@ module Phaser {
public bringToTop(child): bool {
// If child not in this group, or is already at the top of the group, return false
if (child.group.ID != this.ID || child.z == this._zCounter)
if (!child || child.group == null || child.group.ID != this.ID || child.z == this._zCounter)
{
return false;
}