(99a5e8cf8) Fix bots not using the ladders when swimming on the water surface. + merge fix

This commit is contained in:
Joonas Rikkonen
2019-04-26 11:25:41 +03:00
parent 2aec2414be
commit 46f5bd5b15
3 changed files with 6 additions and 23 deletions

View File

@@ -9,8 +9,6 @@ namespace Barotrauma
{
class SinglePlayerCampaign : CampaignMode
{
public ContextualTutorial ContextualTutorial;
private GUIButton endRoundButton;
private bool crewDead;
@@ -41,13 +39,6 @@ namespace Barotrauma
CrewManager.AddCharacterInfo(new CharacterInfo(Character.HumanConfigFile, "", jobPrefab));
}
}
ContextualTutorial = Tutorial.Tutorials.Find(t => t is ContextualTutorial) as ContextualTutorial;
if (ContextualTutorial.Selected) // Selected when starting a new game -> initialize
{
ContextualTutorial.Initialize();
}
}
public override void Start()
@@ -157,11 +148,6 @@ namespace Barotrauma
base.AddToGUIUpdateList();
CrewManager.AddToGUIUpdateList();
endRoundButton.AddToGUIUpdateList();
if (ContextualTutorial.Initialized)
{
ContextualTutorial.AddToGUIUpdateList();
}
}
public override void Update(float deltaTime)
@@ -306,7 +292,6 @@ namespace Barotrauma
TextManager.Get("QuitButton"));
quitButton.OnClicked += GameMain.LobbyScreen.QuitToMainMenu;
quitButton.OnClicked += (GUIButton button, object obj) => { GUIMessageBox.MessageBoxes.Remove(GUIMessageBox.VisibleBox); return true; };
quitButton.OnClicked += (GUIButton button, object obj) => { if (ContextualTutorial.Initialized) ContextualTutorial.Stop(); return true; };
}
}
@@ -391,10 +376,6 @@ namespace Barotrauma
case "map":
campaign.map = Map.LoadNew(subElement);
break;
case "contextualtutorial":
campaign.ContextualTutorial.Initialize(); // Initialize when saved element found
campaign.ContextualTutorial.LoadPartiallyComplete(subElement);
break;
}
}

View File

@@ -223,8 +223,10 @@ namespace Barotrauma
}
}
bool isDiving = character.AnimController.InWater && character.AnimController.HeadInWater;
//only humanoids can climb ladders
if (!character.AnimController.InWater && character.AnimController is HumanoidAnimController && IsNextLadderSameAsCurrent)
if (!isDiving && character.AnimController is HumanoidAnimController && IsNextLadderSameAsCurrent)
{
if (character.SelectedConstruction != currentPath.CurrentNode.Ladders.Item &&
currentPath.CurrentNode.Ladders.Item.IsInsideTrigger(character.WorldPosition))
@@ -234,7 +236,7 @@ namespace Barotrauma
}
var collider = character.AnimController.Collider;
if (character.IsClimbing && !character.AnimController.InWater)
if (character.IsClimbing && !isDiving)
{
Vector2 diff = currentPath.CurrentNode.SimPosition - pos;
bool nextLadderSameAsCurrent = IsNextLadderSameAsCurrent;
@@ -279,7 +281,7 @@ namespace Barotrauma
else if (character.AnimController.InWater)
{
// If the character is underwater, we don't need the ladders anymore
if (character.IsClimbing)
if (character.IsClimbing && isDiving)
{
character.AnimController.Anim = AnimController.Animation.None;
character.SelectedConstruction = null;

View File

@@ -1432,7 +1432,7 @@ namespace Barotrauma
doc.Root.Add(new XAttribute("md5hash", hash.Hash));
if (previewImage != null)
{
//doc.Root.Add(new XAttribute("previewimage", Convert.ToBase64String(previewImage.ToArray())));
doc.Root.Add(new XAttribute("previewimage", Convert.ToBase64String(previewImage.ToArray())));
}
try