fix 'blowing up electric floors doesn't remove the wiring' regression
This commit is contained in:
parent
42d543b235
commit
2df4dc5829
@ -2637,6 +2637,7 @@ export class Level extends LevelInterface {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//only used for glass block atm
|
||||||
if (actor.type.on_death) {
|
if (actor.type.on_death) {
|
||||||
actor.type.on_death(actor, this);
|
actor.type.on_death(actor, this);
|
||||||
}
|
}
|
||||||
@ -2805,6 +2806,11 @@ export class Level extends LevelInterface {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//only used for electrified floor atm
|
||||||
|
if (tile.type.on_death && !tile.type.is_actor) {
|
||||||
|
tile.type.on_death(tile, this);
|
||||||
|
}
|
||||||
|
|
||||||
let old_type = tile.type;
|
let old_type = tile.type;
|
||||||
let new_type = TILE_TYPES[name];
|
let new_type = TILE_TYPES[name];
|
||||||
if (old_type.layer !== new_type.layer) {
|
if (old_type.layer !== new_type.layer) {
|
||||||
|
|||||||
@ -1278,7 +1278,7 @@ const TILE_TYPES = {
|
|||||||
return other.cell.get_item() !== null && me.encased_item !== null;
|
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 dynamite_lit before remove_tile
|
||||||
if (me.encased_item !== null) {
|
if (me.encased_item !== null) {
|
||||||
level._place_dropped_item(me.encased_item, me.cell ?? me.previous_cell, me);
|
level._place_dropped_item(me.encased_item, me.cell ?? me.previous_cell, me);
|
||||||
level._set_tile_prop(me, 'encased_item', null);
|
level._set_tile_prop(me, 'encased_item', null);
|
||||||
@ -1995,7 +1995,7 @@ const TILE_TYPES = {
|
|||||||
level._set_tile_prop(me, 'is_active', false);
|
level._set_tile_prop(me, 'is_active', false);
|
||||||
},
|
},
|
||||||
on_death(me, level) {
|
on_death(me, level) {
|
||||||
// FIXME i probably broke this lol
|
//needs to be called by transmute_tile to ttl and by dynamite_lit before remove_tile
|
||||||
//need to remove our wires since they're an implementation detail
|
//need to remove our wires since they're an implementation detail
|
||||||
level._set_tile_prop(me, 'wire_directions', 0);
|
level._set_tile_prop(me, 'wire_directions', 0);
|
||||||
level.recalculate_circuitry_next_wire_phase = true;
|
level.recalculate_circuitry_next_wire_phase = true;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user