Taking structure offset from origin into account when spawning the sub, repairtool automatically targets last section if welding the second-to-last
This commit is contained in:
@@ -170,13 +170,19 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
//if the next section is small enough, apply the effect to it as well
|
||||
//(to make it easier to fix a small "left-over" section)
|
||||
int nextSectionLength = targetStructure.SectionLength(sectionIndex + 1);
|
||||
if (nextSectionLength > 0 && nextSectionLength < Structure.wallSectionSize * 0.3f)
|
||||
for (int i = -1; i<2; i+=2)
|
||||
{
|
||||
targetStructure.HighLightSection(sectionIndex + 1);
|
||||
targetStructure.AddDamage(sectionIndex + 1, -StructureFixAmount * degreeOfSuccess);
|
||||
int nextSectionLength = targetStructure.SectionLength(sectionIndex + i);
|
||||
if ((sectionIndex==1 && i ==-1) ||
|
||||
(sectionIndex==targetStructure.SectionCount-2 && i == 1) ||
|
||||
(nextSectionLength > 0 && nextSectionLength < Structure.wallSectionSize * 0.3f))
|
||||
{
|
||||
targetStructure.HighLightSection(sectionIndex + i);
|
||||
targetStructure.AddDamage(sectionIndex + i, -StructureFixAmount * degreeOfSuccess);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if ((targetLimb = (targetBody.UserData as Limb)) != null)
|
||||
{
|
||||
|
||||
@@ -239,11 +239,11 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
DrawMarker(spriteBatch,
|
||||
(GameMain.GameSession.Map == null) ? "Start" : GameMain.GameSession.Map.CurrentLocation.Name,
|
||||
(Level.Loaded.StartPosition - (Submarine.Loaded.Position + Submarine.HiddenSubPosition)), displayScale, center, (rect.Width * 0.55f));
|
||||
(Level.Loaded.StartPosition - item.WorldPosition), displayScale, center, (rect.Width * 0.55f));
|
||||
|
||||
DrawMarker(spriteBatch,
|
||||
(GameMain.GameSession.Map == null) ? "End" : GameMain.GameSession.Map.SelectedLocation.Name,
|
||||
(Level.Loaded.EndPosition - (Submarine.Loaded.Position+Submarine.HiddenSubPosition)), displayScale, center, (rect.Width * 0.55f));
|
||||
(Level.Loaded.EndPosition - item.WorldPosition), displayScale, center, (rect.Width * 0.55f));
|
||||
|
||||
if (GameMain.GameSession.Mission != null)
|
||||
{
|
||||
@@ -253,7 +253,7 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
DrawMarker(spriteBatch,
|
||||
mission.RadarLabel,
|
||||
mission.RadarPosition - (Submarine.Loaded.Position + Submarine.HiddenSubPosition), displayScale, center, (rect.Width * 0.55f));
|
||||
mission.RadarPosition - item.WorldPosition, displayScale, center, (rect.Width * 0.55f));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user