Transforming received in-sub mouse coordinates to outside coordinates if the character is outside and vice versa, HiddenSubPosition fix (can't use Level.Loaded to find the top of the level because the level isn't loaded yet)

This commit is contained in:
Regalis
2017-01-05 19:07:18 +02:00
parent 518eea746e
commit beac45458e
7 changed files with 86 additions and 49 deletions

View File

@@ -163,7 +163,7 @@ namespace Barotrauma
return null;
}
Submarine closestSub = Submarine.GetClosest(GameMain.GameScreen.Cam.WorldViewCenter);
Submarine closestSub = Submarine.FindClosest(GameMain.GameScreen.Cam.WorldViewCenter);
if (closestSub != null && (closestSub.AtEndPosition || closestSub.AtStartPosition))
{
return closestSub.DockedTo.Contains(Submarine.MainSub) ? Submarine.MainSub : closestSub;