diff --git a/Source/Activities/GameActivity.cpp b/Source/Activities/GameActivity.cpp index ea32f69a0c..5fb430b18f 100644 --- a/Source/Activities/GameActivity.cpp +++ b/Source/Activities/GameActivity.cpp @@ -1069,7 +1069,7 @@ void GameActivity::UpdateEditing() { DisableAIs(false); InitAIs(); // Reset the mouse value and pathfinding so it'll know about the newly placed stuff - g_UInputMan.SetMouseValueMagnitude(0); + g_UInputMan.SetMouseValueMagnitude(0, g_UInputMan.MouseUsedByPlayer()); g_SceneMan.GetScene()->ResetPathFinding(); // Start the in-game track // g_AudioMan.ClearMusicQueue(); @@ -1249,7 +1249,7 @@ void GameActivity::Update() { if (m_PlayerController[player].IsState(PRESS_SECONDARY)) { // Reset the mouse so the actor doesn't change aim because mouse has been moved if (m_PlayerController[player].IsMouseControlled()) { - g_UInputMan.SetMouseValueMagnitude(0); + g_UInputMan.SetMouseValueMagnitude(0, player); } m_ViewState[player] = ViewState::Normal; @@ -1268,7 +1268,7 @@ void GameActivity::Update() { else if (m_PlayerController[player].IsState(ACTOR_NEXT) || m_PlayerController[player].IsState(ACTOR_PREV) || m_PlayerController[player].IsState(PRESS_FACEBUTTON) || m_PlayerController[player].IsState(PRESS_PRIMARY)) { // Reset the mouse so the actor doesn't change aim because mouse has been moved if (m_PlayerController[player].IsMouseControlled()) { - g_UInputMan.SetMouseValueMagnitude(0); + g_UInputMan.SetMouseValueMagnitude(0, player); } if (pMarkedActor) { diff --git a/Source/Entities/Actor.cpp b/Source/Entities/Actor.cpp index d80548f00a..6aa0c106c1 100644 --- a/Source/Entities/Actor.cpp +++ b/Source/Entities/Actor.cpp @@ -1364,8 +1364,8 @@ void Actor::DrawHUD(BITMAP* pTargetBitmap, const Vector& targetPos, int whichScr } int actorScreen = g_ActivityMan.GetActivity() ? g_ActivityMan.GetActivity()->ScreenOfPlayer(m_Controller.GetPlayer()) : -1; - bool screenTeamIsSameAsActorTeam = g_ActivityMan.GetActivity() ? g_ActivityMan.GetActivity()->GetTeamOfPlayer(whichScreen) == m_Team : true; - if (m_PieMenu->IsVisible() && screenTeamIsSameAsActorTeam && (!m_PieMenu->IsInNormalAnimationMode() || (m_Controller.IsPlayerControlled() && actorScreen == whichScreen))) { + bool screenTeamIsSameAsActorTeam = g_ActivityMan.GetActivity() ? g_ActivityMan.GetActivity()->GetTeamOfPlayer(g_ActivityMan.GetActivity()->PlayerOfScreen(whichScreen)) == m_Team : true; + if (m_PieMenu->IsVisible() && screenTeamIsSameAsActorTeam && (!m_PieMenu->IsInNormalAnimationMode() || (actorScreen == whichScreen))) { m_PieMenu->Draw(pTargetBitmap, targetPos); } diff --git a/Source/Managers/ActivityMan.cpp b/Source/Managers/ActivityMan.cpp index 259a26be49..945012e8c3 100644 --- a/Source/Managers/ActivityMan.cpp +++ b/Source/Managers/ActivityMan.cpp @@ -314,7 +314,7 @@ int ActivityMan::StartActivity(Activity* activity) { g_FrameMan.ClearScreenText(); // Reset the mouse input to the center - g_UInputMan.SetMouseValueMagnitude(0.05F); + g_UInputMan.SetMouseValueMagnitude(0, g_UInputMan.MouseUsedByPlayer()); g_AudioMan.PauseIngameSounds(false); diff --git a/Source/Managers/UInputMan.cpp b/Source/Managers/UInputMan.cpp index 00e011f760..c7f69bf76d 100644 --- a/Source/Managers/UInputMan.cpp +++ b/Source/Managers/UInputMan.cpp @@ -324,15 +324,17 @@ Vector UInputMan::GetMouseMovement(int whichPlayer) const { void UInputMan::SetMouseValueMagnitude(float magCap, int whichPlayer) { if (IsInMultiplayerMode() && whichPlayer >= Players::PlayerOne && whichPlayer < Players::MaxPlayerCount) { m_NetworkAnalogMoveData[whichPlayer].CapMagnitude(m_MouseTrapRadius * magCap); + } else if (whichPlayer != Players::NoPlayer && m_ControlScheme.at(whichPlayer).GetDevice() == InputDevice::DEVICE_MOUSE_KEYB) { + m_AnalogMouseData.SetMagnitude(m_MouseTrapRadius * magCap); } - m_AnalogMouseData.SetMagnitude(m_MouseTrapRadius * magCap); } void UInputMan::SetMouseValueAngle(float angle, int whichPlayer) { if (IsInMultiplayerMode() && whichPlayer >= Players::PlayerOne && whichPlayer < Players::MaxPlayerCount) { m_NetworkAnalogMoveData[whichPlayer].SetAbsRadAngle(angle); + } else if (whichPlayer != Players::NoPlayer && m_ControlScheme.at(whichPlayer).GetDevice() == InputDevice::DEVICE_MOUSE_KEYB) { + m_AnalogMouseData.SetAbsRadAngle(angle); } - m_AnalogMouseData.SetAbsRadAngle(angle); } void UInputMan::SetMousePos(const Vector& newPos, int whichPlayer) const { diff --git a/Source/System/Controller.cpp b/Source/System/Controller.cpp index 2e7c463a11..bf7b92a5fa 100644 --- a/Source/System/Controller.cpp +++ b/Source/System/Controller.cpp @@ -435,7 +435,7 @@ void Controller::UpdatePlayerAnalogInput() { // Disable sharp aim while moving - this also helps with keyboard vs mouse fighting when moving and aiming in opposite directions if (m_ControlStates[ControlState::BODY_JUMP] && !pieMenuActive) { if (IsMouseControlled()) { - g_UInputMan.SetMouseValueMagnitude(0.3F); + g_UInputMan.SetMouseValueMagnitude(0.3F, m_Player); } m_ControlStates[ControlState::AIM_SHARP] = false; }