Using filename as sub name, disposing convexhull vertexbuffers when removing, canceling networkplayer ladder climbing only if movement key pressed

This commit is contained in:
Regalis
2016-01-29 00:08:17 +02:00
parent f5c2dbf22a
commit a1770427a0
5 changed files with 53 additions and 27 deletions

View File

@@ -716,12 +716,20 @@ namespace Barotrauma
}
trigger = character.SelectedConstruction.TransformTrigger(trigger);
bool notClimbing = false;
if (character.IsNetworkPlayer)
{
notClimbing = character.IsKeyDown(InputType.Left) || character.IsKeyDown(InputType.Right);
}
else
{
notClimbing = targetMovement.X != 0.0f;
}
//stop climbing if:
// - going too fast (can't grab a ladder while falling)
// - moving sideways
// - reached the top or bottom of the ladder
if (Math.Abs(torso.LinearVelocity.Y) > 5.0f ||
TargetMovement.X != 0.0f ||
if (notClimbing ||
(TargetMovement.Y < 0.0f && ConvertUnits.ToSimUnits(trigger.Height) + handPos.Y < HeadPosition * 1.5f) ||
(TargetMovement.Y > 0.0f && handPos.Y > 0.1f))
{