Skip to content

Commit

Permalink
fixup: analog sway
Browse files Browse the repository at this point in the history
  • Loading branch information
cylonicboom committed Oct 5, 2023
1 parent 10ba80e commit d821d1f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/game/bondmove.c
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,7 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i
}

movedata.cannaturalturn = !g_Vars.currentplayer->insightaimmode;
movedata.unk14 = 0;
movedata.unk14 = !g_Vars.currentplayer->insightaimmode;

if (g_Vars.tickmode == TICKMODE_AUTOWALK) {
movedata.analogstrafe = 0;
Expand Down
25 changes: 14 additions & 11 deletions src/game/bondwalk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ void bwalkApplyMoveData(struct movedata *data)
} else if (data->unk14 == false) {
bwalkUpdateSpeedSideways(0, 0.2f, g_Vars.lvupdate60);

} else {
} else if (data->unk14){
// TODO: this should be equivalent
bwalkUpdateSpeedSideways(data->analogstrafe * 0.014285714365542f, 0.2f, g_Vars.lvupdate60);
}
Expand Down Expand Up @@ -1364,19 +1364,22 @@ void bwalkApplyMoveData(struct movedata *data)
}

#ifndef PLATFORM_N64
if (data->analoglean) {
if (data->rleanleft) {
bwalkSetSwayTarget(-1);
} else if (data->rleanright) {
bwalkSetSwayTarget(1);
} else if (data->analoglean && bmoveIsInSightAimMode()) {
bwalkSetSwayTargetf(data->analoglean);
} else {
bwalkSetSwayTarget(0);
}
#else
if (data->rleanleft) {
bwalkSetSwayTarget(-1);
} else if (data->rleanright) {
bwalkSetSwayTarget(1);
} else {
bwalkSetSwayTarget(0);
}
#endif
#ifndef PLATFORM_N64
if (data->rleanright) {
bwalkSetSwayTarget(1);
} else if (data->analoglean && bmoveIsInSightAimMode()) {
bwalkSetSwayTargetf(data->analoglean);
} else {
bwalkSetSwayTarget(0);
}
#endif

Expand Down

0 comments on commit d821d1f

Please sign in to comment.