(ff4df7194) Merge branch 'dev' of github.com:Regalis11/Barotrauma-development into dev

This commit is contained in:
Joonas Rikkonen
2019-05-16 06:24:39 +03:00
parent 880b7b1c02
commit dc2f96443a
14 changed files with 366 additions and 142 deletions
@@ -563,6 +563,25 @@ namespace Barotrauma.Items.Components
}
}
if (targetItem.Prefab.DeconstructItems.Any())
{
inputContainer.Inventory.RemoveItem(targetItem);
Entity.Spawner.AddToRemoveQueue(targetItem);
MoveInputQueue();
PutItemsToLinkedContainer();
}
else
{
if (outputContainer.Inventory.Items.All(i => i != null))
{
targetItem.Drop(dropper: null);
}
else
{
outputContainer.Inventory.TryPutItem(targetItem, user: null, createNetworkEvent: true);
}
}
if (targetItem.Prefab.DeconstructItems.Any())
{
inputContainer.Inventory.RemoveItem(targetItem);
@@ -212,33 +212,6 @@ namespace Barotrauma.Items.Components
}
}
public Vector2? PosToMaintain
{
get { return posToMaintain; }
set { posToMaintain = value; }
}
struct ObstacleDebugInfo
{
public Vector2 Point1;
public Vector2 Point2;
public Vector2? Intersection;
public float Dot;
public Vector2 AvoidStrength;
public ObstacleDebugInfo(GraphEdge edge, Vector2? intersection, float dot, Vector2 avoidStrength)
{
Point1 = edge.Point1;
Point2 = edge.Point2;
Intersection = intersection;
Dot = dot;
AvoidStrength = avoidStrength;
}
}
//edge point 1, edge point 2, avoid strength
private List<ObstacleDebugInfo> debugDrawObstacles = new List<ObstacleDebugInfo>();
@@ -495,10 +495,10 @@ namespace Barotrauma.Items.Components
character.CursorPosition = closestEnemy.WorldPosition;
if (item.Submarine != null) character.CursorPosition -= item.Submarine.Position;
if (item.RequireAimToUse)
{
character.SetInput(InputType.Aim, false, true);
}
//force aim input even if the turret doesn't require it,
//because the cursor position (and consequently, turret aim direction) is only synced to clients when aiming
character.SetInput(InputType.Aim, false, true);
float enemyAngle = MathUtils.VectorToAngle(closestEnemy.WorldPosition - item.WorldPosition);
float turretAngle = -rotation;