Build 0.20.7.0

This commit is contained in:
Markus Isberg
2022-11-18 18:13:38 +02:00
parent 8c8fd865c5
commit ecb6d40b4b
111 changed files with 1346 additions and 701 deletions
@@ -9,11 +9,12 @@ namespace Barotrauma.Items.Components
public void ServerEventRead(IReadMessage msg, Client c)
{
uint recipeHash = msg.ReadUInt32();
int amountToFabricate = msg.ReadRangedInteger(1, MaxAmountToFabricate);
item.CreateServerEvent(this);
if (!item.CanClientAccess(c)) { return; }
AmountToFabricate = amountToFabricate;
if (recipeHash == 0)
{
CancelFabricating(c.Character);
@@ -24,6 +25,8 @@ namespace Barotrauma.Items.Components
if (fabricatedItem != null && fabricatedItem.RecipeHash == recipeHash) { return; }
if (recipeHash == 0) { return; }
amountRemaining = AmountToFabricate;
StartFabricating(fabricationRecipes[recipeHash], c.Character);
}
}
@@ -56,6 +59,8 @@ namespace Barotrauma.Items.Components
{
var componentData = ExtractEventData<EventData>(extraData);
msg.WriteByte((byte)componentData.State);
msg.WriteRangedInteger(AmountToFabricate, 0, MaxAmountToFabricate);
msg.WriteRangedInteger(amountRemaining, 0, MaxAmountToFabricate);
msg.WriteSingle(timeUntilReady);
uint recipeHash = fabricatedItem?.RecipeHash ?? 0;
msg.WriteUInt32(recipeHash);