Merge branch 'master' into coolthings

This commit is contained in:
Joonas Rikkonen
2017-12-17 21:11:42 +02:00
committed by GitHub
13 changed files with 102 additions and 34 deletions
@@ -1011,8 +1011,6 @@ namespace Barotrauma
public override void HoldItem(float deltaTime, Item item, Vector2[] handlePos, Vector2 holdPos, Vector2 aimPos, bool aim, float holdAngle)
{
Holdable holdable = item.GetComponent<Holdable>();
if (character.IsUnconscious || character.Stun > 0.0f) aim = false;
//calculate the handle positions
@@ -1030,7 +1028,6 @@ namespace Barotrauma
bool usingController = character.SelectedConstruction != null && character.SelectedConstruction.GetComponent<Controller>() != null;
float itemAngle;
if (Anim != Animation.Climbing && !usingController && character.Stun <= 0.0f && aim && itemPos != Vector2.Zero)
{
@@ -1042,6 +1039,7 @@ namespace Barotrauma
itemAngle = (torso.body.Rotation + holdAngle * Dir);
Holdable holdable = item.GetComponent<Holdable>();
if (holdable.ControlPose)
{
head.body.SmoothRotate(itemAngle);
@@ -947,13 +947,16 @@ namespace Barotrauma
}
}
for (int i = 0; i < selectedItems.Length; i++ )
if (SelectedConstruction == null || !SelectedConstruction.Prefab.DisableItemUsageWhenSelected)
{
if (selectedItems[i] == null) continue;
if (i == 1 && selectedItems[0] == selectedItems[1]) continue;
for (int i = 0; i < selectedItems.Length; i++ )
{
if (selectedItems[i] == null) continue;
if (i == 1 && selectedItems[0] == selectedItems[1]) continue;
if (IsKeyDown(InputType.Use)) selectedItems[i].Use(deltaTime, this);
if (IsKeyDown(InputType.Aim) && selectedItems[i] != null) selectedItems[i].SecondaryUse(deltaTime, this);
if (IsKeyDown(InputType.Use)) selectedItems[i].Use(deltaTime, this);
if (IsKeyDown(InputType.Aim) && selectedItems[i] != null) selectedItems[i].SecondaryUse(deltaTime, this);
}
}
if (selectedConstruction != null)