- 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,8 +335,13 @@ namespace Launcher2
|
||||
return false;
|
||||
}
|
||||
|
||||
if (doc == null) return false;
|
||||
|
||||
if (doc == null)
|
||||
{
|
||||
updateInfoText.Text = "Checking updates failed";
|
||||
updateInfoBox.Visible = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
CheckUpdateXML(doc);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -5,6 +5,8 @@ namespace Barotrauma
|
||||
{
|
||||
class HumanAIController : AIController
|
||||
{
|
||||
public static bool DisableCrewAI;
|
||||
|
||||
const float UpdateObjectiveInterval = 0.5f;
|
||||
|
||||
private AIObjectiveManager objectiveManager;
|
||||
@@ -46,6 +48,8 @@ namespace Barotrauma
|
||||
|
||||
public override void Update(float deltaTime)
|
||||
{
|
||||
if (DisableCrewAI) return;
|
||||
|
||||
Character.ClearInputs();
|
||||
|
||||
//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));
|
||||
}
|
||||
}
|
||||
|
||||
//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))
|
||||
{
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -106,7 +126,7 @@ namespace Barotrauma
|
||||
public override void OnAttacked(IDamageable attacker, float amount)
|
||||
{
|
||||
var enemy = attacker as Character;
|
||||
if (enemy == null) return;
|
||||
if (enemy == null || enemy == Character) return;
|
||||
|
||||
objectiveManager.AddObjective(new AIObjectiveCombat(Character, enemy));
|
||||
}
|
||||
|
||||
@@ -218,6 +218,12 @@ namespace Barotrauma
|
||||
|
||||
if (spawnedCharacter != null && GameMain.Server != null) GameMain.Server.SendCharacterSpawnMessage(spawnedCharacter);
|
||||
|
||||
break;
|
||||
case "disablecrewai":
|
||||
HumanAIController.DisableCrewAI = !HumanAIController.DisableCrewAI;
|
||||
break;
|
||||
case "enablecrewai":
|
||||
HumanAIController.DisableCrewAI = false;
|
||||
break;
|
||||
case "kick":
|
||||
if (GameMain.Server == null) break;
|
||||
|
||||
@@ -435,9 +435,11 @@ namespace Barotrauma
|
||||
|
||||
characterMode = !characterMode;
|
||||
//button.Color = (characterMode) ? Color.Gold : Color.White;
|
||||
|
||||
|
||||
if (characterMode)
|
||||
{
|
||||
if (wiringMode) ToggleWiringMode();
|
||||
|
||||
CreateDummyCharacter();
|
||||
}
|
||||
else if (dummyCharacter != null)
|
||||
|
||||
Reference in New Issue
Block a user