(2d473d38a) Add RequireAimToUse checks for being logical and for future. Shouldn't have any functional implications in the current version, but we could have RepairTools or Weapons that don't require aiming.

This commit is contained in:
Joonas Rikkonen
2019-04-05 16:18:52 +03:00
parent 350e6d6036
commit 8f42801c7a
7 changed files with 49 additions and 142 deletions
@@ -80,6 +80,7 @@ namespace Barotrauma.Items.Components
}
}
item.IsShootable = true;
// TODO: should define this in xml if we have repair tools that don't require aim to use
item.RequireAimToUse = true;
InitProjSpecific(element);
}
@@ -95,7 +96,7 @@ namespace Barotrauma.Items.Components
public override bool Use(float deltaTime, Character character = null)
{
if (character == null || character.Removed) return false;
if (!character.IsKeyDown(InputType.Aim)) return false;
if (item.RequireAimToUse && !character.IsKeyDown(InputType.Aim)) return false;
float degreeOfSuccess = DegreeOfSuccess(character);