summaryrefslogtreecommitdiff
path: root/mm/src/code/z_actor.c
diff options
context:
space:
mode:
authorengineer124 <47598039+engineer124@users.noreply.github.com>2023-11-16 16:28:19 +1100
committerEblo <7004497+Eblo@users.noreply.github.com>2025-09-11 15:02:40 -0400
commitb94791eda52e878b2efc673bd6d83e481db72c4e (patch)
treea2b5d783b606dd4cbcfdc8135412489f6983326e /mm/src/code/z_actor.c
parentb0e30be6ae5c033bcb69d11992857255a32dad38 (diff)
Document Overriding Player Input (#1489)
* Override Input * cleanup * cleanup * PR Review * PR Review, fix merge
Diffstat (limited to 'mm/src/code/z_actor.c')
-rw-r--r--mm/src/code/z_actor.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mm/src/code/z_actor.c b/mm/src/code/z_actor.c
index 8b0c8b858..e98848ce7 100644
--- a/mm/src/code/z_actor.c
+++ b/mm/src/code/z_actor.c
@@ -1437,18 +1437,18 @@ f32 Actor_HeightDiff(Actor* actor1, Actor* actor2) {
}
/**
- * Sets the current and new inputs.
+ * Calculates and sets the control stick x/y values and writes these to input.
*/
-void func_800B6F20(PlayState* play, Input* input, f32 magnitude, s16 baseYaw) {
- s16 relativeYaw = baseYaw - Camera_GetInputDirYaw(GET_ACTIVE_CAM(play));
+void Actor_SetControlStickData(PlayState* play, Input* input, f32 controlStickMagnitude, s16 controlStickAngle) {
+ s16 relativeAngle = controlStickAngle - Camera_GetInputDirYaw(GET_ACTIVE_CAM(play));
- input->cur.stick_x = -Math_SinS(relativeYaw) * magnitude;
+ input->cur.stick_x = -Math_SinS(relativeAngle) * controlStickMagnitude;
// 2S2H [Enhancement] Allow inverting the X axis with GI, primarily for mirror mode,
// otherwise link moves in the opposite direction and likely get soft locked, and
// kafei turns the wrong direction as he paths.
input->cur.stick_x *= GameInteractor_InvertControl(GI_INVERT_MOVEMENT_X);
input->rel.stick_x = input->cur.stick_x;
- input->cur.stick_y = Math_CosS(relativeYaw) * magnitude;
+ input->cur.stick_y = Math_CosS(relativeAngle) * controlStickMagnitude;
input->rel.stick_y = input->cur.stick_y;
}