Fix turning around when hitting a wall on an ice corner

This commit is contained in:
Eevee (Evelyn Woods) 2020-09-05 17:47:33 -06:00
parent a43b7e1d37
commit 4ccf17120b

View File

@ -579,6 +579,13 @@ class Level {
if (actor.slide_mode === 'ice') {
// Actors on ice turn around when they hit something
actor.direction = DIRECTIONS[direction].opposite;
// Somewhat clumsy hack: step on the ice tile again, so if it's
// a corner, it'll turn us in the correct direction
for (let tile of original_cell) {
if (tile.type.slide_mode === 'ice' && tile.type.on_arrive) {
tile.type.on_arrive(tile, this, actor);
}
}
}
return false;
}