v0.3.1a: fixed visual bugs caused by vertigo

This commit is contained in:
Evan Debenham 2015-08-20 08:18:54 -04:00 committed by Evan Debenham
parent e0ad8f1938
commit 3305537ec1

View File

@ -397,9 +397,14 @@ public abstract class Char extends Actor {
public void move( int step ) {
if (Level.adjacent( step, pos ) && buff( Vertigo.class ) != null) {
step = pos + Level.NEIGHBOURS8[Random.Int( 8 )];
if (!(Level.passable[step] || Level.avoid[step]) || Actor.findChar( step ) != null)
sprite.interruptMotion();
int newPos = pos + Level.NEIGHBOURS8[Random.Int( 8 )];
if (!(Level.passable[newPos] || Level.avoid[newPos]) || Actor.findChar( newPos ) != null)
return;
else {
sprite.move(pos, newPos);
step = newPos;
}
}
if (Dungeon.level.map[pos] == Terrain.OPEN_DOOR) {