CPR syncing + some refactoring
Clients send an entityevent to the server when they start/stop doing CPR, and server includes the animation state in messages when character is dragging some other character
This commit is contained in:
@@ -148,7 +148,7 @@ namespace Barotrauma
|
||||
|
||||
if (GameMain.Client != null)
|
||||
{
|
||||
GameMain.Client.CreateEntityEvent(item, new object[] { NetEntityEvent.Type.RepairItem, item.FixRequirements.IndexOf(requirement)});
|
||||
GameMain.Client.CreateEntityEvent(item, new object[] { NetEntityEvent.Type.Repair, item.FixRequirements.IndexOf(requirement)});
|
||||
}
|
||||
else if (GameMain.Server != null)
|
||||
{
|
||||
|
||||
@@ -1815,7 +1815,7 @@ namespace Barotrauma
|
||||
case NetEntityEvent.Type.InventoryState:
|
||||
ownInventory.ClientWrite(msg, extraData);
|
||||
break;
|
||||
case NetEntityEvent.Type.RepairItem:
|
||||
case NetEntityEvent.Type.Repair:
|
||||
if (FixRequirements.Count > 0)
|
||||
{
|
||||
int requirementIndex = (int)extraData[1];
|
||||
@@ -1847,7 +1847,7 @@ namespace Barotrauma
|
||||
case NetEntityEvent.Type.InventoryState:
|
||||
ownInventory.ServerRead(type, msg, c);
|
||||
break;
|
||||
case NetEntityEvent.Type.RepairItem:
|
||||
case NetEntityEvent.Type.Repair:
|
||||
if (FixRequirements.Count == 0) return;
|
||||
|
||||
int requirementIndex = FixRequirements.Count == 1 ?
|
||||
|
||||
Reference in New Issue
Block a user