From 86ad3ddaeea002da77612eb32c85e8eac916a4e8 Mon Sep 17 00:00:00 2001
From: salaaad2 <arthudurant263@gmail.com>
Date: Fri, 20 Mar 2020 22:37:38 +0100
Subject: before norme

---
 src/ft_extra_keys.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

(limited to 'src')

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
-- 
cgit v1.2.3