v0.19.0.0 (unstable)

This commit is contained in:
Regalis11
2022-07-20 18:47:07 +03:00
parent 2e2663a175
commit 6b55adcdd9
170 changed files with 2769 additions and 1634 deletions
@@ -871,13 +871,11 @@ namespace Barotrauma.Items.Components
posToMaintain = item.Submarine.WorldPosition;
}
MaintainPos = true;
if (userdata is Vector2)
if (userdata is Vector2 nudgeAmount)
{
Sonar sonar = item.GetComponent<Sonar>();
Vector2 nudgeAmount = (Vector2)userdata;
if (sonar != null)
if (item.GetComponent<Sonar>() is Sonar sonar)
{
nudgeAmount *= sonar == null ? 500.0f : 500.0f / sonar.Zoom;
nudgeAmount *= 500.0f / sonar.Zoom;
}
PosToMaintain += nudgeAmount;
}