Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Source/Activities/GameActivity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand All @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions Source/Entities/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Managers/ActivityMan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
6 changes: 4 additions & 2 deletions Source/Managers/UInputMan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion Source/System/Controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Loading