- fixed launcher not resetting the "checking for updates" text if it fails to parse the updateinfo xml file
- fixed crashing if switching from wiring mode to character mode - option to disable crew ai through the console
This commit is contained in:
@@ -335,7 +335,12 @@ namespace Launcher2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doc == null) return false;
|
if (doc == null)
|
||||||
|
{
|
||||||
|
updateInfoText.Text = "Checking updates failed";
|
||||||
|
updateInfoBox.Visible = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
CheckUpdateXML(doc);
|
CheckUpdateXML(doc);
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
class HumanAIController : AIController
|
class HumanAIController : AIController
|
||||||
{
|
{
|
||||||
|
public static bool DisableCrewAI;
|
||||||
|
|
||||||
const float UpdateObjectiveInterval = 0.5f;
|
const float UpdateObjectiveInterval = 0.5f;
|
||||||
|
|
||||||
private AIObjectiveManager objectiveManager;
|
private AIObjectiveManager objectiveManager;
|
||||||
@@ -46,6 +48,8 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public override void Update(float deltaTime)
|
public override void Update(float deltaTime)
|
||||||
{
|
{
|
||||||
|
if (DisableCrewAI) return;
|
||||||
|
|
||||||
Character.ClearInputs();
|
Character.ClearInputs();
|
||||||
|
|
||||||
//steeringManager = Character.AnimController.CurrentHull == null ? outdoorsSteeringManager : indoorsSteeringManager;
|
//steeringManager = Character.AnimController.CurrentHull == null ? outdoorsSteeringManager : indoorsSteeringManager;
|
||||||
@@ -85,12 +89,28 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
Character.AnimController.TargetMovement = new Vector2( 0.0f, Math.Sign(Character.AnimController.TargetMovement.Y));
|
Character.AnimController.TargetMovement = new Vector2( 0.0f, Math.Sign(Character.AnimController.TargetMovement.Y));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//unequip diving suit if running out of oxygen
|
||||||
|
if (Character.Oxygen < 50.0f && Character.AnimController.CurrentHull!=null &&
|
||||||
|
Character.AnimController.CurrentHull.Volume < Character.AnimController.CurrentHull.FullVolume*0.3f)
|
||||||
|
{
|
||||||
|
var divingSuit = Character.Inventory.FindItem("Diving Suit");
|
||||||
|
if (divingSuit != null) divingSuit.Drop(Character);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Character.IsKeyDown(InputType.Aim))
|
if (Character.IsKeyDown(InputType.Aim))
|
||||||
{
|
{
|
||||||
Character.AnimController.TargetDir = Character.CursorPosition.X > Character.Position.X ? Direction.Right : Direction.Left;
|
var cursorDiffX = Character.CursorPosition.X - Character.Position.X;
|
||||||
|
if (cursorDiffX > 10.0f)
|
||||||
|
{
|
||||||
|
Character.AnimController.TargetDir = Direction.Right;
|
||||||
|
}
|
||||||
|
else if (cursorDiffX < -10.0f)
|
||||||
|
{
|
||||||
|
Character.AnimController.TargetDir = Direction.Left;
|
||||||
|
}
|
||||||
|
|
||||||
if (Character.SelectedConstruction != null) Character.SelectedConstruction.SecondaryUse(deltaTime, Character);
|
if (Character.SelectedConstruction != null) Character.SelectedConstruction.SecondaryUse(deltaTime, Character);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -106,7 +126,7 @@ namespace Barotrauma
|
|||||||
public override void OnAttacked(IDamageable attacker, float amount)
|
public override void OnAttacked(IDamageable attacker, float amount)
|
||||||
{
|
{
|
||||||
var enemy = attacker as Character;
|
var enemy = attacker as Character;
|
||||||
if (enemy == null) return;
|
if (enemy == null || enemy == Character) return;
|
||||||
|
|
||||||
objectiveManager.AddObjective(new AIObjectiveCombat(Character, enemy));
|
objectiveManager.AddObjective(new AIObjectiveCombat(Character, enemy));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -218,6 +218,12 @@ namespace Barotrauma
|
|||||||
|
|
||||||
if (spawnedCharacter != null && GameMain.Server != null) GameMain.Server.SendCharacterSpawnMessage(spawnedCharacter);
|
if (spawnedCharacter != null && GameMain.Server != null) GameMain.Server.SendCharacterSpawnMessage(spawnedCharacter);
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "disablecrewai":
|
||||||
|
HumanAIController.DisableCrewAI = !HumanAIController.DisableCrewAI;
|
||||||
|
break;
|
||||||
|
case "enablecrewai":
|
||||||
|
HumanAIController.DisableCrewAI = false;
|
||||||
break;
|
break;
|
||||||
case "kick":
|
case "kick":
|
||||||
if (GameMain.Server == null) break;
|
if (GameMain.Server == null) break;
|
||||||
|
|||||||
@@ -438,6 +438,8 @@ namespace Barotrauma
|
|||||||
|
|
||||||
if (characterMode)
|
if (characterMode)
|
||||||
{
|
{
|
||||||
|
if (wiringMode) ToggleWiringMode();
|
||||||
|
|
||||||
CreateDummyCharacter();
|
CreateDummyCharacter();
|
||||||
}
|
}
|
||||||
else if (dummyCharacter != null)
|
else if (dummyCharacter != null)
|
||||||
|
|||||||
Reference in New Issue
Block a user