aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_sprite.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-01 17:23:03 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-01 17:23:03 +0200
commit623c6af72b22aca4bc43009b7039640595521b2e (patch)
treeb3a9896b06552f385c9bc2f536588e31b609fdcb /src/ft_draw_sprite.c
parentKilling skeltons gives ammo, but still segv (diff)
download42-cub3d-623c6af72b22aca4bc43009b7039640595521b2e.tar.gz
42-cub3d-623c6af72b22aca4bc43009b7039640595521b2e.tar.bz2
42-cub3d-623c6af72b22aca4bc43009b7039640595521b2e.tar.xz
42-cub3d-623c6af72b22aca4bc43009b7039640595521b2e.tar.zst
42-cub3d-623c6af72b22aca4bc43009b7039640595521b2e.zip
Still segv but solved invalid read
Diffstat (limited to '')
-rw-r--r--src/ft_draw_sprite.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ft_draw_sprite.c b/src/ft_draw_sprite.c
index 6afac08..a17ab98 100644
--- a/src/ft_draw_sprite.c
+++ b/src/ft_draw_sprite.c
@@ -97,10 +97,11 @@ void
d = sprite->y * 256 - cl->wlist.y_size * 128 +
sprite->spriteheight * 128;
sprite->tex_y = ((d * cl->tlist[sprite->current_sprite].img_h / 2) /
- sprite->spriteheight) / 128;
- if (sprite->transformy > 0 &&
+ sprite->spriteheight) / 128;
+ if (
+ sprite->transformy > 0 &&
cl->tlist[sprite->current_sprite].ptr[sprite->tex_x * 4 + 4 *
- cl->tlist[sprite->current_sprite].img_w * sprite->tex_y]
+ cl->tlist[sprite->current_sprite].img_w * sprite->tex_y]
&& cl->rlist.wall_dist_tab[sprite->x] > sprite->transformy)
ft_put_sprite(sprite, cl);
sprite->y++;