diff --git a/source/games/sw/src/input.cpp b/source/games/sw/src/input.cpp index e72b90dc5..49fca0d1c 100644 --- a/source/games/sw/src/input.cpp +++ b/source/games/sw/src/input.cpp @@ -77,13 +77,13 @@ enum // //--------------------------------------------------------------------------- -static void processWeapon(PLAYER* const pp) +void processWeapon(PLAYER* const pp) { DSWActor* plActor = pp->actor; if (plActor == nullptr) return; int i; - if (loc.getNewWeapon() == WeaponSel_Next) + if (pp->input.getNewWeapon() == WeaponSel_Next) { int next_weapon = plActor->user.WeaponNum + 1; int start_weapon; @@ -116,9 +116,9 @@ static void processWeapon(PLAYER* const pp) } } - loc.setNewWeapon(next_weapon + 1); + pp->input.setNewWeapon(next_weapon + 1); } - else if (loc.getNewWeapon() == WeaponSel_Prev) + else if (pp->input.getNewWeapon() == WeaponSel_Prev) { int prev_weapon = plActor->user.WeaponNum - 1; int start_weapon; @@ -148,12 +148,12 @@ static void processWeapon(PLAYER* const pp) } } } - loc.setNewWeapon(prev_weapon + 1); + pp->input.setNewWeapon(prev_weapon + 1); } - else if (loc.getNewWeapon() == WeaponSel_Alt) + else if (pp->input.getNewWeapon() == WeaponSel_Alt) { int which_weapon = plActor->user.WeaponNum + 1; - loc.setNewWeapon(which_weapon); + pp->input.setNewWeapon(which_weapon); } } @@ -174,7 +174,6 @@ void GameInterface::GetInput(const double scaleAdjust, InputPacket *packet) ApplyGlobalInput(loc, &hidInput); processMovement(&input, &loc, &hidInput, scaleAdjust, 0, !pp->sop, pp->sop_control ? 3. / 1.40625 : 1.); - processWeapon(pp); if (!SyncInput()) { diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index 70e92ca8d..97c93c4e8 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -173,6 +173,7 @@ int GetOverlapSector2(const DVector2& pos, sectortype** over, sectortype** under void PlayerToRemote(PLAYER* pp); void PlayerRemoteInit(PLAYER* pp); void PlayerSpawnPosition(PLAYER* pp); +void processWeapon(PLAYER* const pp); extern short target_ang; @@ -6944,6 +6945,9 @@ void domovethings(void) } } + // process weapon bits + processWeapon(pp); + // auto tracking mode for single player multi-game if (numplayers <= 1 && PlayerTrackingMode && pnum == screenpeek && screenpeek != myconnectindex) {