fix: Initialized textures and perk orders to none for the player

This commit is contained in:
Theo Champion 2025-09-03 16:41:32 +02:00
parent 8d229e9c2b
commit c4e5ff619a
2 changed files with 7 additions and 2 deletions

View file

@ -6,11 +6,12 @@
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */ /* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2025/08/06 11:29:14 by kcolin #+# #+# */ /* Created: 2025/08/06 11:29:14 by kcolin #+# #+# */
/* Updated: 2025/09/01 15:36:43 by tchampio ### ########.fr */ /* Updated: 2025/09/03 16:37:56 by tchampio ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
#include "player.h" #include "player.h"
#include "../../libft/includes/libft.h"
#include "../map/mapdata.h" #include "../map/mapdata.h"
#include "../consts.h" #include "../consts.h"
@ -61,6 +62,7 @@ void init_player(t_player *player, t_mapdata *map)
player->y = map->starty + 0.5; player->y = map->starty + 0.5;
player->health = 100; player->health = 100;
player->points = 500; player->points = 500;
ft_bzero(player->perk_order, 3);
if (dir == 'N' || dir == 'S') if (dir == 'N' || dir == 'S')
init_lon(player, dir); init_lon(player, dir);
else else

View file

@ -6,7 +6,7 @@
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */ /* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2025/07/31 13:43:05 by kcolin #+# #+# */ /* Created: 2025/07/31 13:43:05 by kcolin #+# #+# */
/* Updated: 2025/08/20 17:05:19 by tchampio ### ########.fr */ /* Updated: 2025/09/01 17:49:33 by tchampio ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -64,6 +64,9 @@ void load_textures(t_cub3d_data *data)
data->point_figures[7] = load_single_texture(data, "ressources/seven.xpm"); data->point_figures[7] = load_single_texture(data, "ressources/seven.xpm");
data->point_figures[8] = load_single_texture(data, "ressources/eight.xpm"); data->point_figures[8] = load_single_texture(data, "ressources/eight.xpm");
data->point_figures[9] = load_single_texture(data, "ressources/nine.xpm"); data->point_figures[9] = load_single_texture(data, "ressources/nine.xpm");
data->perk_logos[0] = load_single_texture(data, "ressources/juggernog_logo.xpm");
data->perk_logos[1] = load_single_texture(data, "ressources/revive_logo.xpm");
data->perk_logos[2] = load_single_texture(data, "ressources/doubletap_logo.xpm");
} }
void place_base_sprites(t_cub3d_data *data, char **map) void place_base_sprites(t_cub3d_data *data, char **map)