isTouchingEdge() should not return true for deleted sprite (#2449)

This commit is contained in:
Franklin Tse 2019-10-02 13:38:12 +08:00 committed by Peli de Halleux
parent 65e2cf18bf
commit 10aeeaabf4

View File

@ -633,7 +633,7 @@ namespace game {
//% weight=19 help=game/is-touching-edge //% weight=19 help=game/is-touching-edge
//% blockId=game_sprite_touching_edge block="is %sprite|touching edge" blockGap=8 //% blockId=game_sprite_touching_edge block="is %sprite|touching edge" blockGap=8
public isTouchingEdge(): boolean { public isTouchingEdge(): boolean {
return this._x == 0 || this._x == 4 || this._y == 0 || this._y == 4; return this._enabled && (this._x == 0 || this._x == 4 || this._y == 0 || this._y == 4);
} }
/** /**