Removed redundant data from AICharacter update messages, fixed startlocation name being shown for endlocation on nav terminals
This commit is contained in:
@@ -531,7 +531,6 @@ namespace Barotrauma
|
|||||||
if (GameMain.Server != null) return;
|
if (GameMain.Server != null) return;
|
||||||
|
|
||||||
AiState newState = AiState.None;
|
AiState newState = AiState.None;
|
||||||
Vector2 newWallAttackPos = Vector2.Zero;
|
|
||||||
float wanderAngle;
|
float wanderAngle;
|
||||||
|
|
||||||
ushort targetID;
|
ushort targetID;
|
||||||
@@ -575,6 +574,8 @@ namespace Barotrauma
|
|||||||
|
|
||||||
steeringManager.WanderAngle = wanderAngle;
|
steeringManager.WanderAngle = wanderAngle;
|
||||||
|
|
||||||
|
state = newState;
|
||||||
|
|
||||||
if (targetID > 0) targetEntity = Entity.FindEntityByID(targetID) as IDamageable;
|
if (targetID > 0) targetEntity = Entity.FindEntityByID(targetID) as IDamageable;
|
||||||
//updateTargetsTimer = UpdateTargetsInterval;
|
//updateTargetsTimer = UpdateTargetsInterval;
|
||||||
|
|
||||||
|
|||||||
@@ -94,12 +94,6 @@ namespace Barotrauma
|
|||||||
case NetworkEventType.KillCharacter:
|
case NetworkEventType.KillCharacter:
|
||||||
return true;
|
return true;
|
||||||
case NetworkEventType.ImportantEntityUpdate:
|
case NetworkEventType.ImportantEntityUpdate:
|
||||||
|
|
||||||
message.Write(AnimController.MainLimb.SimPosition.X);
|
|
||||||
message.Write(AnimController.MainLimb.SimPosition.Y);
|
|
||||||
|
|
||||||
//message.Write(AnimController.RefLimb.Rotation);
|
|
||||||
|
|
||||||
message.Write((byte)((health / maxHealth) * 255.0f));
|
message.Write((byte)((health / maxHealth) * 255.0f));
|
||||||
|
|
||||||
message.Write(AnimController.StunTimer > 0.0f);
|
message.Write(AnimController.StunTimer > 0.0f);
|
||||||
@@ -125,8 +119,8 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
|
|
||||||
message.Write(AnimController.Dir > 0.0f);
|
message.Write(AnimController.Dir > 0.0f);
|
||||||
message.WriteRangedSingle(MathHelper.Clamp(AnimController.TargetMovement.X, -1.0f, 1.0f), -1.0f, 1.0f, 4);
|
//message.WriteRangedSingle(MathHelper.Clamp(AnimController.TargetMovement.X, -1.0f, 1.0f), -1.0f, 1.0f, 4);
|
||||||
message.WriteRangedSingle(MathHelper.Clamp(AnimController.TargetMovement.Y, -1.0f, 1.0f), -1.0f, 1.0f, 4);
|
//message.WriteRangedSingle(MathHelper.Clamp(AnimController.TargetMovement.Y, -1.0f, 1.0f), -1.0f, 1.0f, 4);
|
||||||
|
|
||||||
if (AnimController.CanEnterSubmarine) message.Write(Submarine != null);
|
if (AnimController.CanEnterSubmarine) message.Write(Submarine != null);
|
||||||
|
|
||||||
@@ -161,30 +155,6 @@ namespace Barotrauma
|
|||||||
case NetworkEventType.InventoryUpdate:
|
case NetworkEventType.InventoryUpdate:
|
||||||
return base.ReadNetworkData(type, message, sendingTime, out data);
|
return base.ReadNetworkData(type, message, sendingTime, out data);
|
||||||
case NetworkEventType.ImportantEntityUpdate:
|
case NetworkEventType.ImportantEntityUpdate:
|
||||||
|
|
||||||
Vector2 limbPos = AnimController.MainLimb.SimPosition;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
limbPos.X = message.ReadFloat();
|
|
||||||
limbPos.Y = message.ReadFloat();
|
|
||||||
|
|
||||||
//rotation = message.ReadFloat();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
#if DEBUG
|
|
||||||
DebugConsole.ThrowError("Failed to read AICharacter update message", e);
|
|
||||||
#endif
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (AnimController.MainLimb.body != null)
|
|
||||||
{
|
|
||||||
AnimController.MainLimb.body.TargetPosition = limbPos;
|
|
||||||
//AnimController.RefLimb.body.TargetRotation = rotation;
|
|
||||||
}
|
|
||||||
|
|
||||||
float newStunTimer = 0.0f, newHealth = 0.0f, newBleeding = 0.0f;
|
float newStunTimer = 0.0f, newHealth = 0.0f, newBleeding = 0.0f;
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -235,8 +205,8 @@ namespace Barotrauma
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
targetDir = message.ReadBoolean();
|
targetDir = message.ReadBoolean();
|
||||||
targetMovement.X = message.ReadRangedSingle(-1.0f, 1.0f, 4);
|
//targetMovement.X = message.ReadRangedSingle(-1.0f, 1.0f, 4);
|
||||||
targetMovement.Y = message.ReadRangedSingle(-1.0f, 1.0f, 4);
|
//targetMovement.Y = message.ReadRangedSingle(-1.0f, 1.0f, 4);
|
||||||
|
|
||||||
if (AnimController.CanEnterSubmarine) inSub = message.ReadBoolean();
|
if (AnimController.CanEnterSubmarine) inSub = message.ReadBoolean();
|
||||||
|
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
levelEndTickBox = new GUITickBox(
|
levelEndTickBox = new GUITickBox(
|
||||||
new Rectangle(5, 90, 15, 15),
|
new Rectangle(5, 90, 15, 15),
|
||||||
GameMain.GameSession == null ? "" : ToolBox.LimitString(GameMain.GameSession.StartLocation.Name, 20),
|
GameMain.GameSession == null ? "" : ToolBox.LimitString(GameMain.GameSession.EndLocation.Name, 20),
|
||||||
Alignment.TopLeft, GUI.SmallFont, GuiFrame);
|
Alignment.TopLeft, GUI.SmallFont, GuiFrame);
|
||||||
levelEndTickBox.Enabled = false;
|
levelEndTickBox.Enabled = false;
|
||||||
levelEndTickBox.OnSelected = SelectDestination;
|
levelEndTickBox.OnSelected = SelectDestination;
|
||||||
|
|||||||
Reference in New Issue
Block a user