Started refactoring the submarine class in order to make it possible to add multiple submarines (or other movable structures)

This commit is contained in:
Regalis11
2016-06-09 18:34:43 +03:00
parent 0e24eab5e3
commit 41569675f3
33 changed files with 151 additions and 117 deletions
@@ -78,7 +78,7 @@ namespace Barotrauma
Vector2 pos = host.SimPosition;
if (character!=null && character.Submarine==null)
{
pos -= Submarine.Loaded.SimPosition;
pos -= Submarine.MainSub.SimPosition;
}
currentPath = pathFinder.FindPath(pos, target);
@@ -107,7 +107,7 @@ namespace Barotrauma
Vector2 pos2 = host.SimPosition;
if (character != null && character.Submarine == null)
{
pos2 -= Submarine.Loaded.SimPosition;
pos2 -= Submarine.MainSub.SimPosition;
}
return currentTarget-pos2;
}
@@ -120,7 +120,7 @@ namespace Barotrauma
Vector2 pos = host.SimPosition;
if (character != null && character.Submarine == null)
{
pos -= Submarine.Loaded.SimPosition;
pos -= Submarine.MainSub.SimPosition;
}
if (currentPath.CurrentNode!= null && currentPath.CurrentNode.Ladders!=null)