glass block-with-item can't move onto a tile with an item in it

This commit is contained in:
Timothy.Stiles 2021-03-03 14:15:17 +11:00
parent 6971eb4d54
commit e4ce9d0bcc
2 changed files with 8 additions and 2 deletions

View File

@ -92,8 +92,11 @@ export class Tile {
other.type.name !== 'ghost')
return true;
if (this.type.blocks)
return this.type.blocks(this, level, other, direction);
if (this.type.blocks && 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;
}

View File

@ -1350,6 +1350,9 @@ const TILE_TYPES = {
on_finishing_move(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) {
//needs to be called by transmute_tile to ttl and by lit_dynamite before remove_tile
if (me.encased_item !== null) {