X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmap%2FMapState.cpp;fp=src%2Fmap%2FMapState.cpp;h=b18d75da38f685c877618de0796d0dcc3a15ea62;hb=d8cbd000400a1d6f9fcf77e414b6b4d13b1ead96;hp=0e0a3ee44ea7e916ef0cb026c8f1428bf5dca257;hpb=60e0b9e8ec660a4f6b8e500bf0b77a31bb817b45;p=l2e.git diff --git a/src/map/MapState.cpp b/src/map/MapState.cpp index 0e0a3ee..b18d75d 100644 --- a/src/map/MapState.cpp +++ b/src/map/MapState.cpp @@ -32,7 +32,7 @@ MapState::MapState(GameConfig *g, Map *map) , pushed(0) , lastLock(-1, -1) , camera(100, 100, 0) -, walkingSpeed(64) +, walkingSpeed(1) , nextDirection(-1) , afterLock(false) , skipLock(false) @@ -65,6 +65,12 @@ void MapState::OnResize(int width, int height) { } +void MapState::SetWalkingSpeed(int s) { + walkingSpeed = math::Fixed<8>(1, s); + Timestep(s); +} + + void MapState::HandleEvents(const Input &input) { if (input.JustPressed(Input::ACTION_X)) { Ctrl().PushState(new PartyMenu(game)); @@ -102,6 +108,7 @@ void MapState::UpdateWorld(Uint32 deltaT) { } void MapState::OnTileLock() { + // moveTimer is running when the pc is walking against a wall if (moveTimer.Running() && !moveTimer.JustHit()) return; Vector nowLock(ToInt(controlled->Position()));