(65e2b5073) Fixed crashing when an item that requires aim to use is used by something else than a character. Not sure if there are any vanilla items that can cause this error, but can be reproduced for example by creating a projectile that RequiresAimToUse and triggers the Use method when it hits something. Closes #1602

This commit is contained in:
Joonas Rikkonen
2019-06-12 16:44:18 +03:00
parent e3ca616fff
commit b598459179
2 changed files with 1 additions and 53 deletions
@@ -1553,7 +1553,7 @@ namespace Barotrauma
public void Use(float deltaTime, Character character = null, Limb targetLimb = null)
{
if (RequireAimToUse && !character.IsKeyDown(InputType.Aim))
if (RequireAimToUse && (character == null || !character.IsKeyDown(InputType.Aim)))
{
return;
}