Some progress on flipping subs

Press crouch to flip every sub in the map, texture alignment breaks and physics items vanish, but other than that it's working.
This commit is contained in:
juanjp600
2016-09-29 22:20:15 -03:00
parent e22d8adde5
commit f6b82eb095
12 changed files with 207 additions and 56 deletions
+11 -5
View File
@@ -39,6 +39,14 @@ namespace Barotrauma
private bool loadSub;
private Submarine sub;
public Submarine Sub
{
get
{
return sub;
}
}
private XElement saveElement;
public override bool IsLinkable
@@ -48,7 +56,7 @@ namespace Barotrauma
return true;
}
}
public LinkedSubmarine(Submarine submarine)
: base(null, submarine)
{
@@ -386,8 +394,8 @@ namespace Barotrauma
{
if (!loadSub) return;
sub = Submarine.Load(saveElement, false);
sub = Submarine.Load(saveElement, false);
Vector2 worldPos = ToolBox.GetAttributeVector2(saveElement, "worldpos", Vector2.Zero);
if (worldPos != Vector2.Zero)
{
@@ -399,8 +407,6 @@ namespace Barotrauma
sub.Submarine = Submarine;
}
var linkedItem = linkedTo.FirstOrDefault(lt => (lt is Item) && ((Item)lt).GetComponent<DockingPort>() != null);
if (linkedItem == null) return;