(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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user