mirror of
https://codeberg.org/ACME-Corporation/cub3d.git
synced 2025-12-06 01:48:08 +01:00
fix: replaced magic values for their variables counterparts
This commit is contained in:
parent
66c3bda4df
commit
82664c5d13
1 changed files with 5 additions and 5 deletions
10
src/main.c
10
src/main.c
|
|
@ -6,7 +6,7 @@
|
|||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/07/17 14:14:30 by kcolin #+# #+# */
|
||||
/* Updated: 2025/09/17 16:55:39 by tchampio ### ########.fr */
|
||||
/* Updated: 2025/09/18 12:28:33 by tchampio ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -56,15 +56,15 @@ void handle_shooting(t_cub3d_data *data)
|
|||
if (data->player.weapon->clip <= 0 && data->player.weapon->remaining_ammos > 0)
|
||||
{
|
||||
ft_printf("reloading\n");
|
||||
if (data->player.weapon->remaining_ammos < 8)
|
||||
if (data->player.weapon->remaining_ammos < data->player.weapon->base_clip)
|
||||
{
|
||||
data->player.weapon->clip = data->player.weapon->remaining_ammos;
|
||||
data->player.weapon->remaining_ammos = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
data->player.weapon->clip = 8;
|
||||
data->player.weapon->remaining_ammos -= 8;
|
||||
data->player.weapon->clip = data->player.weapon->base_clip;
|
||||
data->player.weapon->remaining_ammos -= data->player.weapon->base_clip;
|
||||
}
|
||||
}
|
||||
if (data->player.weapon->clip <= 0)
|
||||
|
|
@ -74,7 +74,7 @@ void handle_shooting(t_cub3d_data *data)
|
|||
data->player.weapon->clip--;
|
||||
if (data->player.aimed_zombie)
|
||||
{
|
||||
data->player.aimed_zombie->health -= 32;
|
||||
data->player.aimed_zombie->health -= data->player.weapon->damages;
|
||||
data->player.points += 10;
|
||||
ft_printf("Shooting %p, now at %d HP %d/%d\n", data->player.aimed_zombie,
|
||||
data->player.aimed_zombie->health, data->player.weapon->clip, data->player.weapon->remaining_ammos);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue