aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_get_sprite_spawns.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-28 17:02:58 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-28 17:02:58 +0100
commitbd24c47c257ad9c4873207ea131371ad0309f84d (patch)
tree18221c9abd51885e40813fdb73818f65cf751ce8 /src/ft_get_sprite_spawns.c
parentAll in sprites (diff)
download42-cub3d-bd24c47c257ad9c4873207ea131371ad0309f84d.tar.gz
42-cub3d-bd24c47c257ad9c4873207ea131371ad0309f84d.tar.bz2
42-cub3d-bd24c47c257ad9c4873207ea131371ad0309f84d.tar.xz
42-cub3d-bd24c47c257ad9c4873207ea131371ad0309f84d.tar.zst
42-cub3d-bd24c47c257ad9c4873207ea131371ad0309f84d.zip
Awesome
Diffstat (limited to 'src/ft_get_sprite_spawns.c')
-rw-r--r--src/ft_get_sprite_spawns.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/ft_get_sprite_spawns.c b/src/ft_get_sprite_spawns.c
index 0d20664..9329c51 100644
--- a/src/ft_get_sprite_spawns.c
+++ b/src/ft_get_sprite_spawns.c
@@ -35,17 +35,17 @@
static void
ft_check_amount(t_cub *cl, int s_n)
{
- if (s_n < 8 && cl->mlist.sprite_nbr[s_n] >= 4096)
+ if (s_n < 8 && cl->mlist.sprite_nbr[s_n] > 4096)
ft_map_error(FT_ERR_TOO_MUCH_SPRT, cl);
- else if (s_n == 8 && cl->mlist.sprite_nbr[s_n] >= 512)
+ else if (s_n == 8 && cl->mlist.sprite_nbr[s_n] > 512)
ft_map_error(FT_ERR_TOO_MUCH_TRAPS, cl);
- else if (s_n == 9 && cl->mlist.sprite_nbr[s_n] >= 64)
+ else if (s_n == 9 && cl->mlist.sprite_nbr[s_n] > 64)
ft_map_error(FT_ERR_TOO_MUCH_HEALS, cl);
- else if (s_n == 10 && cl->mlist.sprite_nbr[s_n] >= 4)
+ else if (s_n == 10 && cl->mlist.sprite_nbr[s_n] > 4)
ft_map_error(FT_ERR_TOO_MUCH_W_ONE, cl);
- else if (s_n == 11 && cl->mlist.sprite_nbr[s_n] >= 4)
+ else if (s_n == 11 && cl->mlist.sprite_nbr[s_n] > 4)
ft_map_error(FT_ERR_TOO_MUCH_W_TWO, cl);
- else if (s_n == 12 && cl->mlist.sprite_nbr[s_n] >= 4)
+ else if (s_n == 12 && cl->mlist.sprite_nbr[s_n] > 4)
ft_map_error(FT_ERR_TOO_MUCH_W_THREE, cl);
}
@@ -56,15 +56,12 @@ static int8_t
return (ft_get_next_sprite(cl, 8, 'T', 0));
if (s_n + 1 == 9)
return (ft_get_next_sprite(cl, 9, '+', 0));
- if (cl->isdead == 0)
- {
- if (s_n + 1 == 10)
- return (ft_get_next_sprite(cl, 10, '!', 0));
- if (s_n + 1 == 11)
- return (ft_get_next_sprite(cl, 11, '@', 0));
- if (s_n + 1 == 12)
- return (ft_get_next_sprite(cl, 12, '#', 0));
- }
+ if (s_n + 1 == 10)
+ return (ft_get_next_sprite(cl, 10, '!', 0));
+ if (s_n + 1 == 11)
+ return (ft_get_next_sprite(cl, 11, '@', 0));
+ if (s_n + 1 == 12)
+ return (ft_get_next_sprite(cl, 12, '#', 0));
return (0);
}