aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-01 17:26:26 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-01 17:26:26 +0200
commit375436e81665f4e521792d613907432cef4a4f8c (patch)
treeb1375f814da271f3986c515acd44897cb6c3afa0
parentStill segv but solved invalid read (diff)
download42-cub3d-375436e81665f4e521792d613907432cef4a4f8c.tar.gz
42-cub3d-375436e81665f4e521792d613907432cef4a4f8c.tar.bz2
42-cub3d-375436e81665f4e521792d613907432cef4a4f8c.tar.xz
42-cub3d-375436e81665f4e521792d613907432cef4a4f8c.tar.zst
42-cub3d-375436e81665f4e521792d613907432cef4a4f8c.zip
Normed
Diffstat (limited to '')
-rw-r--r--map/map_seven.cub2
-rw-r--r--src/ft_draw_sprite.c1
-rw-r--r--src/ft_find_item.c9
3 files changed, 5 insertions, 7 deletions
diff --git a/map/map_seven.cub b/map/map_seven.cub
index 4b08258..8959a92 100644
--- a/map/map_seven.cub
+++ b/map/map_seven.cub
@@ -1,4 +1,4 @@
-R 300 200
+R 800 600
NO ./media/img/tex/plate_small.xpm
SO ./media/img/tex/plate_small.xpm
diff --git a/src/ft_draw_sprite.c b/src/ft_draw_sprite.c
index a17ab98..655a6e4 100644
--- a/src/ft_draw_sprite.c
+++ b/src/ft_draw_sprite.c
@@ -86,6 +86,7 @@ void
int32_t d;
sprite->x = sprite->drawstartx;
+ ft_printf("current: %d\n", sprite->current_sprite);
while (sprite->x < sprite->drawendx)
{
sprite->tex_x = (int32_t)((sprite->x - (-sprite->spritewidth / 2 +
diff --git a/src/ft_find_item.c b/src/ft_find_item.c
index 6d795c3..bf0f67a 100644
--- a/src/ft_find_item.c
+++ b/src/ft_find_item.c
@@ -68,12 +68,9 @@ static void
if (ft_ischarset(FT_CHRST_WEAPONS, map_char))
{
weap_id = 0;
- if (map_char == '@')
- weap_id = 1;
- else if (map_char == '#')
- weap_id = 2;
- else if (map_char == 'x')
- weap_id = 3;
+ weap_id = (map_char == '@') ? (1) : (weap_id);
+ weap_id = (map_char == '#') ? (2) : (weap_id);
+ weap_id = (map_char == 'x') ? (3) : (weap_id);
cl->mlist.map[(uint64_t)pl->pos_y][(uint64_t)pl->pos_x] = '0';
if (weap_id != 3)
{