mirror of
https://codeberg.org/ACME-Corporation/cub3d.git
synced 2025-12-06 09:58:09 +01:00
fix(sprite caster): Added a check for empty list of sprites to avoid SEGFAULTing
This commit is contained in:
parent
c796d44b56
commit
a0967d5f93
1 changed files with 3 additions and 1 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: tchampio <tchampio@student.42lehavre.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/08/05 15:51:01 by tchampio #+# #+# */
|
||||
/* Updated: 2025/08/07 13:28:07 by tchampio ### ########.fr */
|
||||
/* Updated: 2025/08/07 16:57:29 by tchampio ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -106,6 +106,8 @@ void sprite_caster(t_cub3d_data *data)
|
|||
{
|
||||
int i;
|
||||
|
||||
if (!data->sprite_list)
|
||||
return ;
|
||||
sort_sprites(data->sprite_order, data->sprite_distances, data);
|
||||
i = 0;
|
||||
while (data->sprite_list[i] && i < MAX_SPRITES)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue