diff --git a/game/engines/default/engine/Map.lua b/game/engines/default/engine/Map.lua index 8d10b54..3ca848f 100644 --- a/game/engines/default/engine/Map.lua +++ b/game/engines/default/engine/Map.lua @@ -325,6 +325,8 @@ end --- Redisplays the map, storing seen information function _M:redisplay() + self:checkMapViewBounded() + self._map:setScroll(self.mx, self.my, 0) for i = 0, self.w - 1 do for j = 0, self.h - 1 do self._map:setSeen(i, j, self.seens(i, j)) self._map:setRemember(i, j, self.remembers(i, j)) @@ -769,7 +771,8 @@ function _M:checkMapViewBounded() if self.w < self.viewport.mwidth then self.mx = math.floor((self.w - self.viewport.mwidth) / 2) centered = true self.changed = true end if self.h < self.viewport.mheight then self.my = math.floor((self.h - self.viewport.mheight) / 2) centered = true self.changed = true end - self._map:setScroll(self.mx, self.my, centered and 0 or self.smooth_scroll) +-- self._map:setScroll(self.mx, self.my, centered and 0 or self.smooth_scroll) + self._map:setScroll(self.mx, self.my, self.smooth_scroll) end --- Scrolls the map in the given direction @@ -778,7 +781,7 @@ function _M:scrollDir(dir) self.mx, self.my = util.coordAddDir(self.mx, self.my, dir) self.mx = util.bound(self.mx, 0, self.w - self.viewport.mwidth) self.my = util.bound(self.my, 0, self.h - self.viewport.mheight) - self._map:setScroll(self.mx, self.my, self.smooth_scroll) + self:checkMapViewBounded() end --- Gets the tile under the mouse diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index 040f91b..b74a154 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -726,6 +726,7 @@ function _M:changeLevel(lev, zone, keep_old_lev, force_down, auto_zone_stair) end self.player:onEnterLevel(self.zone, self.level) + self.player:resetMoveAnim() local musics = {} local keep_musics = false diff --git a/src/map.c b/src/map.c index 7e7683c..22d41ad 100644 --- a/src/map.c +++ b/src/map.c @@ -1047,12 +1047,15 @@ static int map_set_scroll(lua_State *L) map->oldmx = map->oldmx + map->used_animdx; map->oldmy = map->oldmy + map->used_animdy; } - map->move_step = 0; - map->move_max = smooth; - map->used_animdx = 0; - map->used_animdy = 0; + } else { + map->oldmx = x; + map->oldmy = y; } + map->move_step = 0; + map->move_max = smooth; + map->used_animdx = 0; + map->used_animdy = 0; map->mx = x; map->my = y; map->seen_changed = TRUE;