Skip to content

Commit

Permalink
Merge pull request #317 from tzachshabtay/WalkDuringSay
Browse files Browse the repository at this point in the history
Walk during say caused fast sliding walking
  • Loading branch information
tzachshabtay committed May 7, 2019
2 parents 49feb71 + 7508b86 commit 9275f92
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public async Task SayAsync(string text, PointF? textPosition = null, PointF? por
label.Dispose();
if (portrait != null) portrait.Visible = false;

if (outfit != null)
if (outfit != null && _faceDirection?.CurrentDirectionalAnimation == speakAnimation) //if the animation is not speakAnimation, somebody switched the animations during speak (perhaps the character is now walking), so we shouldn't revert the animation to what it was before
{
if (wasWalking && !walkComponent.IsWalking) previousAnimation = outfit.Outfit[AGSOutfit.Idle]; //If we were in the middle of a walk but walk was completed before speech, then instead of revert to the previous animation (walk) we need to go to idle.
await setAnimation(previousAnimation);
Expand Down Expand Up @@ -184,4 +184,4 @@ private ISayLocation getLocation(string text)
return _location.GetLocation(text, SpeechConfig);
}
}
}
}

0 comments on commit 9275f92

Please sign in to comment.