aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_handweap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_draw_handweap.c')
-rw-r--r--src/ft_draw_handweap.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ft_draw_handweap.c b/src/ft_draw_handweap.c
index 607cb9a..f171c42 100644
--- a/src/ft_draw_handweap.c
+++ b/src/ft_draw_handweap.c
@@ -28,18 +28,22 @@ static void
}
static int16_t
- ft_set_move(void)
+ ft_set_move(t_cub *cl)
{
static int8_t more = 0;
static int8_t less = 39;
if (more < 38)
{
+ if (!cl->moves)
+ return (more);
more += FT_BOUNCE_FACTOR;
return (more);
}
else
{
+ if (!cl->moves)
+ return (less);
less -= FT_BOUNCE_FACTOR;
if (less < 1)
{
@@ -67,7 +71,7 @@ void
x_ratio = (int32_t)(((cl->tweap[w_id].img_w - 50) << 16) / cl->wlist.x_size) + 1;
y_ratio = (int32_t)(((cl->tweap[w_id].img_h - 50) << 16) / cl->wlist.y_size) + 1;
y = 0;
- move = ft_set_move();
+ move = ft_set_move(cl);
move = (cl->plist.fire == 1) ? (0) : (move);
while (y < (int16_t)cl->wlist.y_size)
{