glass block-with-item can't move onto a tile with an item in it
This commit is contained in:
parent
6971eb4d54
commit
e4ce9d0bcc
@ -92,8 +92,11 @@ export class Tile {
|
|||||||
other.type.name !== 'ghost')
|
other.type.name !== 'ghost')
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (this.type.blocks)
|
if (this.type.blocks && this.type.blocks(this, level, other, direction))
|
||||||
return this.type.blocks(this, level, other, direction);
|
return true;
|
||||||
|
|
||||||
|
if (other.type.blocked_by && other.type.blocked_by(other, level, this))
|
||||||
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1350,6 +1350,9 @@ const TILE_TYPES = {
|
|||||||
on_finishing_move(me, level) {
|
on_finishing_move(me, level) {
|
||||||
this.try_pickup_item(me, level);
|
this.try_pickup_item(me, level);
|
||||||
},
|
},
|
||||||
|
blocked_by(me, level, other) {
|
||||||
|
return other.cell.get_item() !== null && me.encased_item !== null;
|
||||||
|
},
|
||||||
on_death(me, level) {
|
on_death(me, level) {
|
||||||
//needs to be called by transmute_tile to ttl and by lit_dynamite before remove_tile
|
//needs to be called by transmute_tile to ttl and by lit_dynamite before remove_tile
|
||||||
if (me.encased_item !== null) {
|
if (me.encased_item !== null) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user