aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ft_extra_keys.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/ft_extra_keys.c b/src/ft_extra_keys.c
index a801dee..96636a8 100644
--- a/src/ft_extra_keys.c
+++ b/src/ft_extra_keys.c
@@ -71,11 +71,8 @@ int
}
void
-ft_hitscan(t_cub *cl)
+ ft_hitscan(t_cub *cl, uint16_t hit)
{
- uint8_t hit;
-
- hit = 0;
while (hit == 0)
{
if (cl->rlist.x_side_dist < cl->rlist.y_side_dist)
@@ -90,18 +87,16 @@ ft_hitscan(t_cub *cl)
cl->rlist.sqy += cl->mlist.y_step;
cl->rlist.side = 1;
}
- if (ft_ischarset("234567",
+ if (ft_ischarset("23456",
cl->mlist.map[cl->rlist.sqx][cl->rlist.sqy]))
{
hit = 1;
- puts("hit");
+ cl->mlist.map[cl->rlist.sqx][cl->rlist.sqy] = '0';
+ ft_get_sprite_spawn(cl);
}
else if (ft_ischarset("1",
cl->mlist.map[cl->rlist.sqx][cl->rlist.sqy]))
- {
hit = 1;
- puts("wall (you missed retard)");
- }
}
}
@@ -124,7 +119,7 @@ void
cl->rlist.sqy = (int16_t)cl->rlist.y_ray_pos;
ft_detection_init_x(cl);
ft_detection_init_y(cl);
- ft_hitscan(cl);
+ ft_hitscan(cl, 0);
}
int