aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_warp_level.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-19 20:25:54 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-19 20:25:54 +0100
commit5798c414690561950b53a3c9f9478891e75ec91f (patch)
treec068cea671eb4c80fefbebcee35460481afe8e5f /src/ft_warp_level.c
parentNow making second weapon (diff)
download42-cub3d-5798c414690561950b53a3c9f9478891e75ec91f.tar.gz
42-cub3d-5798c414690561950b53a3c9f9478891e75ec91f.tar.bz2
42-cub3d-5798c414690561950b53a3c9f9478891e75ec91f.tar.xz
42-cub3d-5798c414690561950b53a3c9f9478891e75ec91f.tar.zst
42-cub3d-5798c414690561950b53a3c9f9478891e75ec91f.zip
New images, that'll do the trick
Diffstat (limited to 'src/ft_warp_level.c')
-rw-r--r--src/ft_warp_level.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/ft_warp_level.c b/src/ft_warp_level.c
index 6962a1d..4618766 100644
--- a/src/ft_warp_level.c
+++ b/src/ft_warp_level.c
@@ -42,11 +42,32 @@ static void
}
static void
+ ft_player_keepings(t_cub *cl)
+{
+ int8_t tmp_life;
+ uint8_t tmp_has[2];
+ int8_t tmp_handles;
+
+ tmp_life = cl->plist.life;
+ tmp_has[0] = cl->plist.has_weapon[0];
+ tmp_has[1] = cl->plist.has_weapon[1];
+ tmp_handles = cl->plist.handles_weapon;
+ cl->plist = ft_init_player();
+ if (!cl->isdead)
+ cl->plist.life = tmp_life;
+ else
+ cl->isdead = 0;
+ cl->plist.has_weapon[0] = tmp_has[0];
+ cl->plist.has_weapon[1] = tmp_has[1];
+ cl->plist.handles_weapon = tmp_handles;
+}
+
+static void
ft_del_some(t_cub *cl)
{
int8_t i;
- cl->plist = ft_init_player();
+ ft_player_keepings(cl);
cl->f_rgb = ft_init_rgb();
cl->c_rgb = ft_init_rgb();
cl->rlist = ft_init_s_ray();