diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-19 14:57:04 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-19 14:57:04 +0100 |
commit | ebcfbdc44e2cdc64dca661520e8d0db2652da64e (patch) | |
tree | 687b919c4b859476ed495f7a5d68dfc41fe9af96 /src/ft_get_weapon_spawn.c | |
parent | Parsed weapons spawns (diff) | |
download | 42-cub3d-ebcfbdc44e2cdc64dca661520e8d0db2652da64e.tar.gz 42-cub3d-ebcfbdc44e2cdc64dca661520e8d0db2652da64e.tar.bz2 42-cub3d-ebcfbdc44e2cdc64dca661520e8d0db2652da64e.tar.xz 42-cub3d-ebcfbdc44e2cdc64dca661520e8d0db2652da64e.tar.zst 42-cub3d-ebcfbdc44e2cdc64dca661520e8d0db2652da64e.zip |
Weapons sprites do draw
Diffstat (limited to 'src/ft_get_weapon_spawn.c')
-rw-r--r-- | src/ft_get_weapon_spawn.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/ft_get_weapon_spawn.c b/src/ft_get_weapon_spawn.c index d9b7d52..a54d2b6 100644 --- a/src/ft_get_weapon_spawn.c +++ b/src/ft_get_weapon_spawn.c @@ -19,9 +19,16 @@ static void { clist->mlist.weaps_nbr[id]++; if (clist->mlist.weaps_nbr[id] > 1) - ft_map_error(FT_ERR_TOO_MUCH_W_ONE, clist); + { + if (id == 0) + ft_map_error(FT_ERR_TOO_MUCH_W_ONE, clist); + else + ft_map_error(FT_ERR_TOO_MUCH_W_TWO, clist); + } clist->weaps[id][0].s_pos_x = x; clist->weaps[id][0].s_pos_y = y; + clist->weaps[id][0].current_sprite = 18 + id; + clist->mlist.weapon_var++; } void @@ -32,15 +39,14 @@ void x = 1; y = 1; - i = 0; while (clist->mlist.map[y]) { while (clist->mlist.map[y][x]) { if (clist->mlist.map[y][x] == '!') - ft_get_weapon_one_spawn(0, y, x, clist); + ft_get_weapon_id_spawn(0, y, x, clist); else if (clist->mlist.map[y][x] == '@') - ft_get_weapon_two_spawn(1, y, x, clist); + ft_get_weapon_id_spawn(1, y, x, clist); x++; } x = 1; |