Fixed propulsion applying force to _every limb except_ the ones it's supposed to, fixed pressure building up in enclosed rooms that are full of water, fixed netlobby displaying multiple votes for clients, progress on file transfer

This commit is contained in:
Regalis
2016-02-26 22:21:00 +02:00
parent 77d3d22810
commit 9f8f4e290e
19 changed files with 330 additions and 133 deletions
@@ -558,27 +558,12 @@ namespace Barotrauma
bool wallAttack = (wallAttackPos != Vector2.Zero && state == AiState.Attack);
message.Write(wallAttack);
//if (wallAttack)
//{
// Vector2 relativeWallAttackPos = wallAttackPos - Submarine.Loaded.SimPosition;
// message.WriteRangedSingle(MathHelper.Clamp(relativeWallAttackPos.X, -50.0f, 50.0f), -50.0f, 50.0f, 10);
// message.WriteRangedSingle(MathHelper.Clamp(relativeWallAttackPos.Y, -50.0f, 50.0f), -50.0f, 50.0f, 10);
//}
//message.Write(Velocity.X);
//message.Write(Velocity.Y);
//message.Write(Character.AnimController.RefLimb.SimPosition.X);
//message.Write(Character.AnimController.RefLimb.SimPosition.Y);
//message.Write(wallAttack);
message.Write(MathUtils.AngleToByte(steeringManager.WanderAngle));
//message.WriteRangedSingle(MathHelper.Clamp(updateTargetsTimer,0.0f, UpdateTargetsInterval), 0.0f, UpdateTargetsInterval, 8);
//message.WriteRangedSingle(MathHelper.Clamp(raycastTimer, 0.0f, RaycastInterval), 0.0f, RaycastInterval, 8);
//message.WriteRangedSingle(MathHelper.Clamp(coolDownTimer, 0.0f, attackCoolDown * 2.0f), 0.0f, attackCoolDown * 2.0f, 8);
coolDownTimer = MathHelper.Clamp(coolDownTimer, 0.0f, 30.0f);
message.WriteRangedSingle(coolDownTimer, 0.0f, 30.0f, 8);
message.Write(targetEntity==null ? (ushort)0 : (targetEntity as Entity).ID);
}
@@ -612,9 +597,8 @@ namespace Barotrauma
//targetPosition = new Vector2(message.ReadFloat(), message.ReadFloat());
wanderAngle = MathUtils.ByteToAngle(message.ReadByte());
//updateTargetsTimer = message.ReadRangedSingle(0.0f, UpdateTargetsInterval, 8);
//raycastTimer = message.ReadRangedSingle(0.0f, RaycastInterval, 8);
//coolDownTimer = message.ReadRangedSingle(0.0f, attackCoolDown*2.0f, 8);
coolDownTimer = message.ReadRangedSingle(0.0f, 30.0f, 8);
targetID = message.ReadUInt16();
}
@@ -629,14 +613,10 @@ namespace Barotrauma
return;
}
//wallAttackPos = newWallAttackPos;
steeringManager.WanderAngle = wanderAngle;
//this.updateTargetsTimer = updateTargetsTimer;
//this.raycastTimer = raycastTimer;
//this.coolDownTimer = coolDownTimer;
if (targetID > 0) targetEntity = Entity.FindEntityByID(targetID) as IDamageable;
if (targetID > 0) targetEntity = Entity.FindEntityByID(targetID) as IDamageable;
updateTargetsTimer = UpdateTargetsInterval;
}
}
@@ -647,14 +627,8 @@ namespace Barotrauma
//and if the target attacks the Character, the priority increases)
class AITargetMemory
{
//private AITarget target;
private float priority;
//public AITarget Target
//{
// get { return target; }
//}
public float Priority
{
get { return priority; }
+2 -2
View File
@@ -10,9 +10,9 @@ namespace Barotrauma
class StatusEffect
{
[Flags]
public enum TargetType
public enum TargetType
{
This = 1, Parent = 2, Character = 4, Contained = 8, Nearby = 16, UseTarget=32
This = 1, Parent = 2, Character = 4, Contained = 8, Nearby = 16, UseTarget = 32, Hull = 64
}
private TargetType targetTypes;