]> git.localhorst.tv Git - l2e.git/blobdiff - src/map/Entity.cpp
added tile ladder flag
[l2e.git] / src / map / Entity.cpp
index d239844ea2ef420bd76fd5e47a57dbe7082359e0..6bce2adfde82b28d092cd08a03eae7fd39246f7e 100644 (file)
@@ -26,6 +26,7 @@ Entity::Entity()
 , partyLayout(0)
 , monsters(0)
 , numMonsters(0)
+, direction(ORIENTATION_NORTH)
 , orientation(ORIENTATION_NORTH)
 , speed(0)
 , flags(0) {
@@ -35,12 +36,17 @@ Entity::Entity()
 
 void Entity::SetOrientation(Orientation o) {
        orientation = o;
-       UpdateVelocity();
        if (CanTurn()) {
-               runner.SetColOffset(orientation);
+               runner.SetColOffset(o);
        }
 }
 
+void Entity::SetDirection(Orientation o) {
+       direction = o;
+       UpdateVelocity();
+       SetOrientation(o);
+}
+
 void Entity::SetSpeed(Fixed<8> s) {
        speed = s;
        UpdateVelocity();
@@ -103,7 +109,7 @@ void Entity::UpdateVelocity() {
                velocity = Vector<Fixed<8> >();
                return;
        }
-       switch (orientation) {
+       switch (direction) {
                case ORIENTATION_NORTH:
                        velocity = Vector<Fixed<8> >(0, -speed);
                        break;