Unstable v0.1300.0.0 (February 19th 2021)
This commit is contained in:
@@ -58,10 +58,14 @@ namespace Barotrauma.MapCreatures.Behavior
|
||||
msg.Write(branch.Health);
|
||||
}
|
||||
|
||||
public void ServerWriteInfect(IWriteMessage msg, UInt16 itemID, bool infect)
|
||||
public void ServerWriteInfect(IWriteMessage msg, UInt16 itemID, bool infect, BallastFloraBranch infector = null)
|
||||
{
|
||||
msg.Write(itemID);
|
||||
msg.Write(infect);
|
||||
if (infect)
|
||||
{
|
||||
msg.Write(infector?.ID ?? -1);
|
||||
}
|
||||
}
|
||||
|
||||
public void ServerWriteBranchRemove(IWriteMessage msg, BallastFloraBranch branch)
|
||||
|
||||
@@ -93,7 +93,9 @@ namespace Barotrauma
|
||||
behavior.ServerWriteBranchRemove(message, branch);
|
||||
break;
|
||||
case BallastFloraBehavior.NetworkHeader.Infect when extraData.Length >= 4 && extraData[2] is UInt16 itemID && extraData[3] is bool infect:
|
||||
behavior.ServerWriteInfect(message, itemID, infect);
|
||||
BallastFloraBranch infector = null;
|
||||
if (extraData.Length >= 5 && extraData[4] is BallastFloraBranch b) { infector = b; }
|
||||
behavior.ServerWriteInfect(message, itemID, infect, infector);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -223,7 +225,7 @@ namespace Barotrauma
|
||||
byte decalIndex = msg.ReadByte();
|
||||
float decalAlpha = msg.ReadRangedSingle(0.0f, 1.0f, 255);
|
||||
if (decalIndex < 0 || decalIndex >= decals.Count) { return; }
|
||||
if (c.Character != null && c.Character.AllowInput && c.Character.SelectedItems.Any(it => it?.GetComponent<Sprayer>() != null))
|
||||
if (c.Character != null && c.Character.AllowInput && c.Character.HeldItems.Any(it => it.GetComponent<Sprayer>() != null))
|
||||
{
|
||||
decals[decalIndex].BaseAlpha = decalAlpha;
|
||||
}
|
||||
@@ -240,7 +242,7 @@ namespace Barotrauma
|
||||
Color color = new Color(msg.ReadUInt32());
|
||||
|
||||
//TODO: verify the client is close enough to this hull to paint it, that the sprayer is functional and that the color matches
|
||||
if (c.Character != null && c.Character.AllowInput && c.Character.SelectedItems.Any(it => it?.GetComponent<Sprayer>() != null))
|
||||
if (c.Character != null && c.Character.AllowInput && c.Character.HeldItems.Any(it => it.GetComponent<Sprayer>() != null))
|
||||
{
|
||||
BackgroundSections[i].SetColorStrength(colorStrength);
|
||||
BackgroundSections[i].SetColor(color);
|
||||
|
||||
Reference in New Issue
Block a user