From 69ca60b6f989dedc94c2e25ab9927b26d63cbdf8 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sun, 29 Mar 2020 17:34:48 +0200 Subject: Norm --- src/ft_get_weapon_spawn.c | 59 ----------------------------------------------- 1 file changed, 59 deletions(-) delete mode 100644 src/ft_get_weapon_spawn.c (limited to 'src/ft_get_weapon_spawn.c') diff --git a/src/ft_get_weapon_spawn.c b/src/ft_get_weapon_spawn.c deleted file mode 100644 index 1ed4c7d..0000000 --- a/src/ft_get_weapon_spawn.c +++ /dev/null @@ -1,59 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_get_weapon_spawn.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: rbousset +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/02/28 20:54:28 by rbousset #+# #+# */ -/* Updated: 2020/02/28 20:54:29 by rbousset ### ########lyon.fr */ -/* */ -/* ************************************************************************** */ - -#include -#include -#include - -static void - ft_get_weapon_id_spawn(uint8_t id, size_t y, size_t x, t_cub *clist) -{ - clist->mlist.weaps_nbr[id]++; - if (clist->mlist.weaps_nbr[id] > 1) - { - if (id == 0) - ft_map_error(FT_ERR_TOO_MUCH_W_ONE, clist); - else if (id == 1) - ft_map_error(FT_ERR_TOO_MUCH_W_TWO, clist); - else - ft_map_error(FT_ERR_TOO_MUCH_W_THREE, clist); - } - clist->weaps[id][0].s_pos_x = x; - clist->weaps[id][0].s_pos_y = y; - clist->weaps[id][0].current_sprite = 18 + id; - clist->mlist.weapon_var++; -} - -void - ft_get_weapon_spawn(t_cub *clist) -{ - size_t x; - size_t y; - - x = 1; - y = 1; - while (clist->mlist.map[y]) - { - while (clist->mlist.map[y][x]) - { - if (clist->mlist.map[y][x] == '!') - ft_get_weapon_id_spawn(0, y, x, clist); - else if (clist->mlist.map[y][x] == '@') - ft_get_weapon_id_spawn(1, y, x, clist); - else if (clist->mlist.map[y][x] == '#') - ft_get_weapon_id_spawn(2, y, x, clist); - x++; - } - x = 1; - y++; - } -} -- cgit v1.2.3