GrabLimb type is written in character network messages as byte instead of UInt16

This commit is contained in:
Joonas Rikkonen
2018-03-01 23:43:10 +02:00
parent 31ba9e20a2
commit 10189254b5
2 changed files with 4 additions and 4 deletions
@@ -29,7 +29,7 @@ namespace Barotrauma
break; break;
case NetEntityEvent.Type.Control: case NetEntityEvent.Type.Control:
msg.WriteRangedInteger(0, 3, 3); msg.WriteRangedInteger(0, 3, 3);
msg.Write((UInt16)AnimController.GrabLimb); msg.Write((byte)AnimController.GrabLimb);
break; break;
} }
} }
@@ -95,7 +95,7 @@ namespace Barotrauma
bool crouching = msg.ReadBoolean(); bool crouching = msg.ReadBoolean();
keys[(int)InputType.Crouch].Held = crouching; keys[(int)InputType.Crouch].Held = crouching;
keys[(int)InputType.Crouch].SetState(false, crouching); keys[(int)InputType.Crouch].SetState(false, crouching);
AnimController.GrabLimb = (LimbType)msg.ReadUInt16(); AnimController.GrabLimb = (LimbType)msg.ReadByte();
} }
bool hasAttackLimb = msg.ReadBoolean(); bool hasAttackLimb = msg.ReadBoolean();
@@ -358,7 +358,7 @@ namespace Barotrauma
} }
break; break;
case 3: case 3:
LimbType grabLimb = (LimbType)msg.ReadUInt16(); LimbType grabLimb = (LimbType)msg.ReadByte();
if (c.Character != this) if (c.Character != this)
{ {
#if DEBUG #if DEBUG
@@ -449,7 +449,7 @@ namespace Barotrauma
if (AnimController is HumanoidAnimController) if (AnimController is HumanoidAnimController)
{ {
tempBuffer.Write(((HumanoidAnimController)AnimController).Crouching); tempBuffer.Write(((HumanoidAnimController)AnimController).Crouching);
tempBuffer.Write((UInt16)AnimController.GrabLimb); tempBuffer.Write((byte)AnimController.GrabLimb);
} }
bool hasAttackLimb = AnimController.Limbs.Any(l => l != null && l.attack != null); bool hasAttackLimb = AnimController.Limbs.Any(l => l != null && l.attack != null);