(83dad7f87) Fixed crashing when attempting to use the turrets in character mode in the sub editor

This commit is contained in:
Joonas Rikkonen
2019-04-05 16:20:42 +03:00
parent e086af2c6f
commit 11a77e3694
3 changed files with 105 additions and 32 deletions
@@ -339,11 +339,10 @@ namespace Barotrauma.Items.Components
}
}
if (crosshairSprite != null)
{
crosshairSprite.Draw(spriteBatch, crosshairPos, readyToFire ? Color.White : Color.White * 0.2f, 0, (float)Math.Sqrt(cam.Zoom));
}
if (crosshairPointerSprite != null) crosshairPointerSprite.Draw(spriteBatch, crosshairPointerPos, 0, (float)Math.Sqrt(cam.Zoom));
float zoom = cam == null ? 1.0f : (float)Math.Sqrt(cam.Zoom);
crosshairSprite?.Draw(spriteBatch, crosshairPos, readyToFire ? Color.White : Color.White * 0.2f, 0, zoom);
crosshairPointerSprite?.Draw(spriteBatch, crosshairPointerPos, 0, zoom);
}
public void ClientRead(ServerNetObject type, NetBuffer msg, float sendingTime)