Skip to content

Commit 18b8894

Browse files
committed
2 parents 26f011c + 3c9c309 commit 18b8894

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

Source/Activities/GameActivity.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ void GameActivity::UpdateEditing() {
10691069
DisableAIs(false);
10701070
InitAIs();
10711071
// Reset the mouse value and pathfinding so it'll know about the newly placed stuff
1072-
g_UInputMan.SetMouseValueMagnitude(0);
1072+
g_UInputMan.SetMouseValueMagnitude(0, g_UInputMan.MouseUsedByPlayer());
10731073
g_SceneMan.GetScene()->ResetPathFinding();
10741074
// Start the in-game track
10751075
// g_AudioMan.ClearMusicQueue();
@@ -1249,7 +1249,7 @@ void GameActivity::Update() {
12491249
if (m_PlayerController[player].IsState(PRESS_SECONDARY)) {
12501250
// Reset the mouse so the actor doesn't change aim because mouse has been moved
12511251
if (m_PlayerController[player].IsMouseControlled()) {
1252-
g_UInputMan.SetMouseValueMagnitude(0);
1252+
g_UInputMan.SetMouseValueMagnitude(0, player);
12531253
}
12541254

12551255
m_ViewState[player] = ViewState::Normal;
@@ -1268,7 +1268,7 @@ void GameActivity::Update() {
12681268
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)) {
12691269
// Reset the mouse so the actor doesn't change aim because mouse has been moved
12701270
if (m_PlayerController[player].IsMouseControlled()) {
1271-
g_UInputMan.SetMouseValueMagnitude(0);
1271+
g_UInputMan.SetMouseValueMagnitude(0, player);
12721272
}
12731273

12741274
if (pMarkedActor) {

Source/Entities/Actor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,8 +1364,8 @@ void Actor::DrawHUD(BITMAP* pTargetBitmap, const Vector& targetPos, int whichScr
13641364
}
13651365

13661366
int actorScreen = g_ActivityMan.GetActivity() ? g_ActivityMan.GetActivity()->ScreenOfPlayer(m_Controller.GetPlayer()) : -1;
1367-
bool screenTeamIsSameAsActorTeam = g_ActivityMan.GetActivity() ? g_ActivityMan.GetActivity()->GetTeamOfPlayer(whichScreen) == m_Team : true;
1368-
if (m_PieMenu->IsVisible() && screenTeamIsSameAsActorTeam && (!m_PieMenu->IsInNormalAnimationMode() || (m_Controller.IsPlayerControlled() && actorScreen == whichScreen))) {
1367+
bool screenTeamIsSameAsActorTeam = g_ActivityMan.GetActivity() ? g_ActivityMan.GetActivity()->GetTeamOfPlayer(g_ActivityMan.GetActivity()->PlayerOfScreen(whichScreen)) == m_Team : true;
1368+
if (m_PieMenu->IsVisible() && screenTeamIsSameAsActorTeam && (!m_PieMenu->IsInNormalAnimationMode() || (actorScreen == whichScreen))) {
13691369
m_PieMenu->Draw(pTargetBitmap, targetPos);
13701370
}
13711371

Source/Managers/ActivityMan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ int ActivityMan::StartActivity(Activity* activity) {
314314
g_FrameMan.ClearScreenText();
315315

316316
// Reset the mouse input to the center
317-
g_UInputMan.SetMouseValueMagnitude(0.05F);
317+
g_UInputMan.SetMouseValueMagnitude(0, g_UInputMan.MouseUsedByPlayer());
318318

319319
g_AudioMan.PauseIngameSounds(false);
320320

Source/Managers/UInputMan.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,15 +324,17 @@ Vector UInputMan::GetMouseMovement(int whichPlayer) const {
324324
void UInputMan::SetMouseValueMagnitude(float magCap, int whichPlayer) {
325325
if (IsInMultiplayerMode() && whichPlayer >= Players::PlayerOne && whichPlayer < Players::MaxPlayerCount) {
326326
m_NetworkAnalogMoveData[whichPlayer].CapMagnitude(m_MouseTrapRadius * magCap);
327+
} else if (whichPlayer != Players::NoPlayer && m_ControlScheme.at(whichPlayer).GetDevice() == InputDevice::DEVICE_MOUSE_KEYB) {
328+
m_AnalogMouseData.SetMagnitude(m_MouseTrapRadius * magCap);
327329
}
328-
m_AnalogMouseData.SetMagnitude(m_MouseTrapRadius * magCap);
329330
}
330331

331332
void UInputMan::SetMouseValueAngle(float angle, int whichPlayer) {
332333
if (IsInMultiplayerMode() && whichPlayer >= Players::PlayerOne && whichPlayer < Players::MaxPlayerCount) {
333334
m_NetworkAnalogMoveData[whichPlayer].SetAbsRadAngle(angle);
335+
} else if (whichPlayer != Players::NoPlayer && m_ControlScheme.at(whichPlayer).GetDevice() == InputDevice::DEVICE_MOUSE_KEYB) {
336+
m_AnalogMouseData.SetAbsRadAngle(angle);
334337
}
335-
m_AnalogMouseData.SetAbsRadAngle(angle);
336338
}
337339

338340
void UInputMan::SetMousePos(const Vector& newPos, int whichPlayer) const {

Source/System/Controller.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ void Controller::UpdatePlayerAnalogInput() {
435435
// Disable sharp aim while moving - this also helps with keyboard vs mouse fighting when moving and aiming in opposite directions
436436
if (m_ControlStates[ControlState::BODY_JUMP] && !pieMenuActive) {
437437
if (IsMouseControlled()) {
438-
g_UInputMan.SetMouseValueMagnitude(0.3F);
438+
g_UInputMan.SetMouseValueMagnitude(0.3F, m_Player);
439439
}
440440
m_ControlStates[ControlState::AIM_SHARP] = false;
441441
}

0 commit comments

Comments
 (0)