aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-11 01:44:15 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-11 01:44:15 +0100
commita752af80e3778b8a17b53b49b11ed235494a623d (patch)
treea87173aa567829977a7f332ebacdefe83dc0edb3
parentNorme (diff)
download42-cub3d-a752af80e3778b8a17b53b49b11ed235494a623d.tar.gz
42-cub3d-a752af80e3778b8a17b53b49b11ed235494a623d.tar.bz2
42-cub3d-a752af80e3778b8a17b53b49b11ed235494a623d.tar.xz
42-cub3d-a752af80e3778b8a17b53b49b11ed235494a623d.tar.zst
42-cub3d-a752af80e3778b8a17b53b49b11ed235494a623d.zip
Sliding like a champ
Diffstat (limited to '')
-rw-r--r--src/ft_key_loop.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ft_key_loop.c b/src/ft_key_loop.c
index d40de34..d3e871b 100644
--- a/src/ft_key_loop.c
+++ b/src/ft_key_loop.c
@@ -53,12 +53,12 @@ static void
pl = &cl->plist;
x = ft_find_x(key, pl);
y = ft_find_y(key, pl);
- if (ft_ischarset(FT_CHRST_COLLISION, cl->mlist.map[y][x]) ||
- cl->mlist.map[y][x] == '\0')
- {
- pl->pos_y = old_y;
+ if (ft_ischarset(FT_CHRST_COLLISION, cl->mlist.map[(uint64_t)old_y][x]) ||
+ cl->mlist.map[(uint64_t)old_y][x] == '\0')
pl->pos_x = old_x;
- }
+ if (ft_ischarset(FT_CHRST_COLLISION, cl->mlist.map[y][(uint64_t)old_x]) ||
+ cl->mlist.map[y][(uint64_t)old_x] == '\0')
+ pl->pos_y = old_y;
}
int