Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Character flipping enhancements #14673

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/master' into spawnflipped
  • Loading branch information
TheNinjaScout committed Oct 22, 2024
commit 4721c6d60424f602f3982f8979f6d0aa15336533
29 changes: 5 additions & 24 deletions Barotrauma/BarotraumaShared/SharedSource/Characters/Character.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2188,7 +2188,11 @@ public void Control(float deltaTime, Camera cam)
((!IsClimbing && AnimController.OnGround) || (IsClimbing && IsKeyDown(InputType.Aim))) &&
!AnimController.InWater)
{
if (AnimController is not FishAnimController)
if (!FollowCursor)
{
AnimController.TargetDir = Direction.Right;
}
else
{
if (CursorPosition.X < AnimController.Collider.Position.X - cursorFollowMargin)
{
Expand All @@ -2199,10 +2203,6 @@ public void Control(float deltaTime, Camera cam)
AnimController.TargetDir = Direction.Right;
}
}
if (AnimController is HumanoidAnimController && dontFollowCursor) // For character editor
{
AnimController.TargetDir = Direction.Right;
}
}

if (GameMain.NetworkMember != null)
Expand Down Expand Up @@ -5994,25 +5994,6 @@ public void StopClimbing()
AnimController.StopClimbing();
ReleaseSecondaryItem();
}

public void TryFlipCharacter()
{
if (AnimController is FishAnimController fishAnimController)
{
if (fishAnimController.CurrentFishAnimation.Flip)
{
fishAnimController.Flip();
}
}
else
{
AnimController.TargetDir = (AnimController.TargetDir == Direction.Left) ? Direction.Right : Direction.Left;
if (!CanMove)
{
AnimController.Flip();
}
}
}
}

class ActiveTeamChange
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.