(99a5e8cf8) Fix bots not using the ladders when swimming on the water surface. + merge fix
This commit is contained in:
@@ -9,8 +9,6 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
class SinglePlayerCampaign : CampaignMode
|
class SinglePlayerCampaign : CampaignMode
|
||||||
{
|
{
|
||||||
public ContextualTutorial ContextualTutorial;
|
|
||||||
|
|
||||||
private GUIButton endRoundButton;
|
private GUIButton endRoundButton;
|
||||||
|
|
||||||
private bool crewDead;
|
private bool crewDead;
|
||||||
@@ -41,13 +39,6 @@ namespace Barotrauma
|
|||||||
CrewManager.AddCharacterInfo(new CharacterInfo(Character.HumanConfigFile, "", jobPrefab));
|
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()
|
public override void Start()
|
||||||
@@ -157,11 +148,6 @@ namespace Barotrauma
|
|||||||
base.AddToGUIUpdateList();
|
base.AddToGUIUpdateList();
|
||||||
CrewManager.AddToGUIUpdateList();
|
CrewManager.AddToGUIUpdateList();
|
||||||
endRoundButton.AddToGUIUpdateList();
|
endRoundButton.AddToGUIUpdateList();
|
||||||
|
|
||||||
if (ContextualTutorial.Initialized)
|
|
||||||
{
|
|
||||||
ContextualTutorial.AddToGUIUpdateList();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Update(float deltaTime)
|
public override void Update(float deltaTime)
|
||||||
@@ -306,7 +292,6 @@ namespace Barotrauma
|
|||||||
TextManager.Get("QuitButton"));
|
TextManager.Get("QuitButton"));
|
||||||
quitButton.OnClicked += GameMain.LobbyScreen.QuitToMainMenu;
|
quitButton.OnClicked += GameMain.LobbyScreen.QuitToMainMenu;
|
||||||
quitButton.OnClicked += (GUIButton button, object obj) => { GUIMessageBox.MessageBoxes.Remove(GUIMessageBox.VisibleBox); return true; };
|
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":
|
case "map":
|
||||||
campaign.map = Map.LoadNew(subElement);
|
campaign.map = Map.LoadNew(subElement);
|
||||||
break;
|
break;
|
||||||
case "contextualtutorial":
|
|
||||||
campaign.ContextualTutorial.Initialize(); // Initialize when saved element found
|
|
||||||
campaign.ContextualTutorial.LoadPartiallyComplete(subElement);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -223,8 +223,10 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isDiving = character.AnimController.InWater && character.AnimController.HeadInWater;
|
||||||
|
|
||||||
//only humanoids can climb ladders
|
//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 &&
|
if (character.SelectedConstruction != currentPath.CurrentNode.Ladders.Item &&
|
||||||
currentPath.CurrentNode.Ladders.Item.IsInsideTrigger(character.WorldPosition))
|
currentPath.CurrentNode.Ladders.Item.IsInsideTrigger(character.WorldPosition))
|
||||||
@@ -234,7 +236,7 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
|
|
||||||
var collider = character.AnimController.Collider;
|
var collider = character.AnimController.Collider;
|
||||||
if (character.IsClimbing && !character.AnimController.InWater)
|
if (character.IsClimbing && !isDiving)
|
||||||
{
|
{
|
||||||
Vector2 diff = currentPath.CurrentNode.SimPosition - pos;
|
Vector2 diff = currentPath.CurrentNode.SimPosition - pos;
|
||||||
bool nextLadderSameAsCurrent = IsNextLadderSameAsCurrent;
|
bool nextLadderSameAsCurrent = IsNextLadderSameAsCurrent;
|
||||||
@@ -279,7 +281,7 @@ namespace Barotrauma
|
|||||||
else if (character.AnimController.InWater)
|
else if (character.AnimController.InWater)
|
||||||
{
|
{
|
||||||
// If the character is underwater, we don't need the ladders anymore
|
// 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.AnimController.Anim = AnimController.Animation.None;
|
||||||
character.SelectedConstruction = null;
|
character.SelectedConstruction = null;
|
||||||
|
|||||||
@@ -1432,7 +1432,7 @@ namespace Barotrauma
|
|||||||
doc.Root.Add(new XAttribute("md5hash", hash.Hash));
|
doc.Root.Add(new XAttribute("md5hash", hash.Hash));
|
||||||
if (previewImage != null)
|
if (previewImage != null)
|
||||||
{
|
{
|
||||||
//doc.Root.Add(new XAttribute("previewimage", Convert.ToBase64String(previewImage.ToArray())));
|
doc.Root.Add(new XAttribute("previewimage", Convert.ToBase64String(previewImage.ToArray())));
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|||||||
Reference in New Issue
Block a user