We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 183896f commit fb04cd4Copy full SHA for fb04cd4
1 file changed
src/gameobjects/container/Container.js
@@ -137,10 +137,12 @@ var Container = new Class({
137
{
138
gameObject.on('destroy', this.remove, this);
139
140
- if (gameObject.type === 'Container')
+ if (gameObject.parentContainer)
141
142
- gameObject.parentContainer = list;
+ gameObject.parentContainer.remove(gameObject);
143
}
144
+
145
+ gameObject.parentContainer = list;
146
},
147
148
/**
@@ -157,10 +159,7 @@ var Container = new Class({
157
159
158
160
gameObject.off('destroy', list.remove, this);
161
- {
162
- gameObject.parentContainer = null;
163
- }
+ gameObject.parentContainer = null;
164
165
166
0 commit comments