Controllers don't have to be wired directly to an item for camera focus to work (= railguns and cameras can be used over wifi). Closes #535

This commit is contained in:
Joonas Rikkonen
2018-07-31 15:03:20 +03:00
parent d81ee1a27e
commit 82103cf394
5 changed files with 42 additions and 21 deletions
@@ -6,9 +6,7 @@ namespace Barotrauma.Items.Components
{
public override void DrawHUD(SpriteBatch spriteBatch, Character character)
{
var focusTarget = GetFocusTarget();
if (focusTarget == null) return;
if (character.ViewTarget == focusTarget)
if (focusTarget != null && character.ViewTarget == focusTarget)
{
foreach (ItemComponent ic in focusTarget.components)
{