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

This commit is contained in:
Franklin Tse authored and Peli de Halleux committed 2019-10-01 22:38:12 -07:00
1 parent 65e2cf18bf
commit 10aeeaabf4
1 file changed
+1 -1
+1 -1
View File
@@ -633,7 +633,7 @@ namespace game {
//% weight=19 help=game/is-touching-edge
//% blockId=game_sprite_touching_edge block="is %sprite|touching edge" blockGap=8
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);
}
/**