Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions engine/ecs/systems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ void movementSystem(entt::registry &registry, std::vector<engine::Tile> &tiles,
sf::Vector2f delta = vel.value * speed.value * dt;

auto canMove = [&](float newX, float newY) {
int tileX = static_cast<int>(newX) - 1;
int tileY = static_cast<int>(newY);
int tileX = static_cast<int>(std::floor(newX)) - 1;
int tileY = static_cast<int>(std::floor(newY));
if (tileX < 0 || tileX >= worldWidth || tileY < 0 ||
tileY >= worldHeight)
return false;
Expand Down