Improve the follow modes for too far ranges#6190
Improve the follow modes for too far ranges#6190sturnclaw merged 2 commits intopioneerspacesim:masterfrom
Conversation
src/ship/PlayerShipController.cpp
Outdated
| if (InputBindings.primaryFire->IsActive() || (Pi::input->MouseButtonState(SDL_BUTTON_LEFT) && Pi::input->MouseButtonState(SDL_BUTTON_RIGHT))) { | ||
| //XXX worldview? madness, ask from ship instead | ||
| m_ship->SetGunState(Pi::game->GetWorldView()->GetActiveWeapon(), 1); | ||
| if (gunManager && | ||
| (InputBindings.primaryFire->IsActive() || (Pi::input->MouseButtonState(SDL_BUTTON_LEFT) && Pi::input->MouseButtonState(SDL_BUTTON_RIGHT)))) { | ||
| gunManager->SetAllGroupsFiring(true); |
There was a problem hiding this comment.
Note that this change will cause weapons in group 0 (by default, forward-facing weapons) to fire when the player is looking backwards and trying to fire weapons in group 1 (by default, rear-facing weapons).
I'm not sure we currently have ships with rear-facing weapons at this time, but I'd appreciate a comment here indicating that support for per-view weapon groups needs to be restored in the future.
There was a problem hiding this comment.
@sturnclaw Maybe then to do it right away?
gunManager->SetGroupFiring(Pi::game->GetWorldView()->GetActiveWeapon(), true);There was a problem hiding this comment.
That works, thank you. In the future I'd like to assign mounts to individual views or "seats" (e.g. crew-manned turrets) but for now we can use the WorldView.
There was a problem hiding this comment.
Force-pushed this change.
|
At least in my case, it has worked well. |
because it is deprecated
- distinguish limit range for follow position and follow orientation modes - automatically turn off the follow mode if the distance to the target has become too large for this mode - accordingly modify the flight assist button code See also: pioneerspacesim#6081
f4a65c2 to
a6f0109
Compare
|
Merged, thank you! |
Probably a slightly more thorough solution to the problem of #6081.
If earlier this problem was solved through the opportunity to manually turn off the follow mode, even when it is too far for it, now it is turned off automatically. Also, a different maximum range is assigned for different modes. For follow position mode, this is 1000 km, since it can be convenient for intercepting the ship. For the follow orientation mode, it is 10 km, since it makes little sense over long distances, and the ship most likely cannot correctly follow the rotating target.
Also along the way fixed some warnings in
PlayerShipController.