From e75926c89391d28ea586362158767daaa876c759 Mon Sep 17 00:00:00 2001 From: hgn Date: Wed, 4 Oct 2023 06:23:30 +0100 Subject: [PATCH] variable length exchange --- player_walk.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/player_walk.c b/player_walk.c index 1306e2a..6400d30 100644 --- a/player_walk.c +++ b/player_walk.c @@ -972,11 +972,11 @@ static void player__walk_animator_exchange( bitpack_ctx *ctx, void *data ){ bitpack_qf32( ctx, 8, 0.0f, 1.0f, &animator->walk ); bitpack_qf32( ctx, 16, 0.0f, 120.0f, &animator->walk_timer ); - /* we can do variable length exchanges now? */ - - bitpack_bytes( ctx, sizeof(animator->foot_anchor), animator->foot_anchor ); bitpack_bytes( ctx, 8, &animator->outro_type ); - bitpack_qf32( ctx, 8, 0.0f, 1.0f, &animator->outro_t ); - bitpack_qf32( ctx, 8, 0.0f, 1.0f, &animator->commit_t ); + if( animator->outro_type ){ + bitpack_bytes(ctx, sizeof(animator->foot_anchor), animator->foot_anchor ); + bitpack_qf32( ctx, 8, 0.0f, 1.0f, &animator->outro_t ); + bitpack_qf32( ctx, 8, 0.0f, 1.0f, &animator->commit_t ); + } } #endif /* PLAYER_DEVICE_WALK_H */ -- 2.25.1