I DID IT HOLY SHIT I GONE AND DONE IT

OnSecondaryUse is what throwing uses for doing things SPECIFICALLY on throw. This way, you can theoretically have grenades on which you'll have to pull the pin before throwing.
This also lets flares be used without the need to throw them.
did i mention my brain hurts
This commit is contained in:
Alex Noir
2017-12-10 15:56:34 +03:00
parent 231a38f71d
commit 55dd58579f
5 changed files with 22 additions and 10 deletions
@@ -165,15 +165,15 @@ namespace Barotrauma.Items.Components
if (this.character == null || this.character != character || this.character.SelectedConstruction != item || !character.CanInteractWith(item))
{
character = null;
return;
return false;
}
if (character == null) return;
if (character == null) return false;
Entity focusTarget = GetFocusTarget();
if (focusTarget == null)
{
item.SendSignal(0, XMLExtensions.Vector2ToString(character.CursorWorldPosition), "position_out", character);
return;
return false;
}
character.ViewTarget = focusTarget;
@@ -191,6 +191,8 @@ namespace Barotrauma.Items.Components
{
item.SendSignal(0, XMLExtensions.Vector2ToString(character.CursorWorldPosition), "position_out", character);
}
return true;
}
private Item GetFocusTarget()