Remove blocks' knowledge of their pusher's speed

This commit is contained in:
Eevee (Evelyn Woods) 2020-09-14 21:09:05 -06:00
parent c214aeb0c6
commit 045bcb5789

View File

@ -590,7 +590,7 @@ export class Level {
// Try to move the given actor one tile in the given direction and update
// their cooldown. Return true if successful.
attempt_step(actor, direction, pusher_speed = null) {
attempt_step(actor, direction) {
if (actor.stuck)
return false;
@ -635,9 +635,7 @@ export class Level {
if (actor.type.pushes && actor.type.pushes[tile.type.name] && tile.movement_cooldown === 0 && ! tile.stuck) {
this.set_actor_direction(tile, direction);
// FIXME the speed adjustment at the end of all this should go before this
// call, but this all needs splitting up anyway
if (this.attempt_step(tile, direction, speed))
if (this.attempt_step(tile, direction))
// It moved out of the way!
continue;
}
@ -672,11 +670,6 @@ export class Level {
return false;
}
// We cannot possibly move more slowly than something pushing us
if (pusher_speed !== null) {
speed = Math.min(speed, pusher_speed);
}
// We're clear!
this.move_to(actor, goal_cell, speed);