Fix release blocker: Endless swimming anims on water/air transition
This commit is contained in:
@@ -653,10 +653,15 @@ void LLFloaterAO::toggleSwim(bool underwater)
|
||||
AOState state = getAnimationState();
|
||||
if (state != STATE_AGENT_IDLE && state != STATE_AGENT_STAND) // Don't bother if we're just standing or idle (Who pushed us?!)
|
||||
{
|
||||
// Stop flying/swimming
|
||||
gAgent.sendAnimationRequest(GetAnimIDFromState(sSwimming ? swimToFlyState(state) : flyToSwimState(state)), ANIM_REQUEST_STOP);
|
||||
// Start swimming/flying
|
||||
gAgent.sendAnimationRequest(GetAnimIDFromState(state), ANIM_REQUEST_START);
|
||||
// Stop all of the previous states
|
||||
constexpr std::array<AOState, 4> swim_states = { STATE_AGENT_FLOAT, STATE_AGENT_SWIM, STATE_AGENT_SWIM_UP, STATE_AGENT_SWIM_DOWN };
|
||||
constexpr std::array<AOState, 4> fly_states = { STATE_AGENT_HOVER, STATE_AGENT_FLY, STATE_AGENT_HOVER_UP, STATE_AGENT_HOVER_DOWN };
|
||||
uuid_vec_t vec;
|
||||
for (const auto& state : swim ? fly_states : swim_states)
|
||||
vec.push_back(GetAnimIDFromState(state));
|
||||
gAgent.sendAnimationRequests(vec, ANIM_REQUEST_STOP);
|
||||
// Process new animations
|
||||
gAgentAvatarp->processAnimationStateChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user