Merge pull request #891 from aivins/issue890

Separate from TilemapLayer after custom callbacks.
This commit is contained in:
Richard Davey 2014-06-11 00:00:20 +01:00
commit 13700148fb

View file

@ -670,13 +670,12 @@ Phaser.Physics.Arcade.prototype = {
} }
for (var i = 0; i < this._mapData.length; i++) for (var i = 0; i < this._mapData.length; i++)
{ {
if (this.separateTile(i, sprite.body, this._mapData[i])) if (processCallback)
{ {
// They collided, is there a custom process callback? if (processCallback.call(callbackContext, sprite, this._mapData[i]))
if (processCallback)
{ {
if (processCallback.call(callbackContext, sprite, this._mapData[i])) if (this.separateTile(i, sprite.body, this._mapData[i]))
{ {
this._total++; this._total++;
@ -686,7 +685,10 @@ Phaser.Physics.Arcade.prototype = {
} }
} }
} }
else }
else
{
if (this.separateTile(i, sprite.body, this._mapData[i]))
{ {
this._total++; this._total++;