diff options
-rw-r--r-- | inc/cub3d_defines.h | 3 | ||||
-rw-r--r-- | map/adv_three.cub | 1 | ||||
-rw-r--r-- | src/ft_check_missing.c | 3 | ||||
-rw-r--r-- | src/ft_check_missing_defines.c | 12 | ||||
-rw-r--r-- | src/ft_tex_init.c | 18 |
5 files changed, 29 insertions, 8 deletions
diff --git a/inc/cub3d_defines.h b/inc/cub3d_defines.h index 2829095..650f1fc 100644 --- a/inc/cub3d_defines.h +++ b/inc/cub3d_defines.h @@ -132,7 +132,8 @@ enum # define FT_CB_WALK_PATH "./media/img/sprites/chr_cb2.xpm" # define FT_CB_FIRE_PATH "./media/img/sprites/chr_cb3.xpm" # define FT_CB_DEAD_PATH "./media/img/sprites/chr_cbd.xpm" -# define FT_HEAL_PACK_PATH "./media/img/sprites/sr_hp.xpm" +# define FT_HEAL_PACK_PATH "./media/img/sprites/first_aid.xpm" +# define FT_WHISK_PACK_PATH "./media/img/sprites/sr_hp.xpm" # define FT_ZER_PATH "./media/img/hud/zero.xpm" # define FT_ONE_PATH "./media/img/hud/one.xpm" # define FT_TWO_PATH "./media/img/hud/two.xpm" diff --git a/map/adv_three.cub b/map/adv_three.cub index 301fd4d..4b3de8a 100644 --- a/map/adv_three.cub +++ b/map/adv_three.cub @@ -15,6 +15,7 @@ L ./map/map_seven.cub LT ./media/img/tex/hol.xpm MU ./media/sound/big_iron.wav + E2 1111111111111111111 diff --git a/src/ft_check_missing.c b/src/ft_check_missing.c index 2b49d2e..a0cb16f 100644 --- a/src/ft_check_missing.c +++ b/src/ft_check_missing.c @@ -30,9 +30,6 @@ static int if (ft_check_not_found(FT_WEAPON_TWO_SPR_PATH) < 0 || ft_check_ext(FT_WEAPON_TWO_SPR_PATH, ".xpm") < 0) return (ft_missing_error(FT_ERR_MISS_W_TWO_SPR, clist)); - if (ft_check_not_found(FT_HEAL_PACK_PATH) < 0 || - ft_check_ext(FT_HEAL_PACK_PATH, ".xpm") < 0) - return (ft_missing_error(FT_ERR_MISS_HEAL_PACK, clist)); i = 0; while ((i + 2) <= clist->mlist.topsp) { diff --git a/src/ft_check_missing_defines.c b/src/ft_check_missing_defines.c index 6c616b0..7994a8a 100644 --- a/src/ft_check_missing_defines.c +++ b/src/ft_check_missing_defines.c @@ -25,6 +25,18 @@ static int if (ft_check_not_found(FT_CAP_AMMO_PATH) < 0 || ft_check_ext(FT_CAP_AMMO_PATH, ".xpm") < 0) return (ft_missing_error(FT_ERR_MISS_A_CAPTION, clist)); + if (clist->mlist.enemy == 1) + { + if (ft_check_not_found(FT_HEAL_PACK_PATH) < 0 || + ft_check_ext(FT_HEAL_PACK_PATH, ".xpm") < 0) + return (ft_missing_error(FT_ERR_MISS_HEAL_PACK, clist)); + } + else + { + if (ft_check_not_found(FT_HEAL_PACK_PATH) < 0 || + ft_check_ext(FT_HEAL_PACK_PATH, ".xpm") < 0) + return (ft_missing_error(FT_ERR_MISS_HEAL_PACK, clist)); + } return (ft_check_missing_sfx(clist)); } diff --git a/src/ft_tex_init.c b/src/ft_tex_init.c index d629f76..c034ce3 100644 --- a/src/ft_tex_init.c +++ b/src/ft_tex_init.c @@ -98,10 +98,20 @@ static void } if (cl->mlist.isheals) { - cl->tlist[17].img = mlx_xpm_file_to_image(cl->wlist.wlx, - FT_HEAL_PACK_PATH, &cl->tlist[17].img_w, &cl->tlist[17].img_h); - cl->tlist[17].ptr = mlx_get_data_addr(cl->tlist[17].img, - &cl->tlist[17].bpp, &cl->tlist[17].sizeline, &cl->tlist[17].endian); + if (cl->mlist.enemy == 1) + { + cl->tlist[17].img = mlx_xpm_file_to_image(cl->wlist.wlx, + FT_HEAL_PACK_PATH, &cl->tlist[17].img_w, &cl->tlist[17].img_h); + cl->tlist[17].ptr = mlx_get_data_addr(cl->tlist[17].img, + &cl->tlist[17].bpp, &cl->tlist[17].sizeline, &cl->tlist[17].endian); + } + else + { + cl->tlist[17].img = mlx_xpm_file_to_image(cl->wlist.wlx, + FT_WHISK_PACK_PATH, &cl->tlist[17].img_w, &cl->tlist[17].img_h); + cl->tlist[17].ptr = mlx_get_data_addr(cl->tlist[17].img, + &cl->tlist[17].bpp, &cl->tlist[17].sizeline, &cl->tlist[17].endian); + } } ft_wall_tex_init_more_bonus(cl); } |