mirror of
https://codeberg.org/ACME-Corporation/cub3d.git
synced 2025-12-06 01:48:08 +01:00
fix: prevent crash due to out-of-bounds when game lags
This commit is contained in:
parent
1d6d97ef25
commit
a18c115ef1
7 changed files with 90 additions and 26 deletions
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* player.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: tchampio <tchampio@student.42lehavre. +#+ +:+ +#+ */
|
||||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/07/29 11:42:44 by tchampio #+# #+# */
|
||||
/* Updated: 2025/07/29 20:13:01 by tchampio ### ########.fr */
|
||||
/* Created: 2025/08/06 11:29:14 by kcolin #+# #+# */
|
||||
/* Updated: 2025/08/06 11:29:14 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -59,7 +59,6 @@ void init_player(t_player *player, t_mapdata *map)
|
|||
dir = map->map[map->starty][map->startx];
|
||||
player->x = map->startx + 0.5;
|
||||
player->y = map->starty + 0.5;
|
||||
map->map[map->starty][map->startx] = '0';
|
||||
player->health = 100;
|
||||
player->points = 500;
|
||||
if (dir == 'N' || dir == 'S')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue