Skip to content

Commit

Permalink
Revamp sending of WorldPacket
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed Dec 22, 2024
1 parent c3bcf6e commit 6102743
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions Fika.Core/Coop/HostClasses/FikaHostWorld.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,18 @@ protected void FixedUpdate()
Throwable throwable = gameWorld.Grenades.GetByIndex(i);
gameWorld.method_2(throwable);
}

foreach (GStruct131 grenadeStruct in gameWorld.GrenadesCriticalStates)
{
WorldPacket.ThrowablePackets.Add(grenadeStruct);
}

foreach (GStruct130 artilleryStruct in gameWorld.ArtilleryProjectilesStates)
{
WorldPacket.ArtilleryPackets.Add(artilleryStruct);
}

gameWorld.GrenadesCriticalStates.Clear();
gameWorld.ArtilleryProjectilesStates.Clear();

WorldPacket.ThrowablePackets.AddRange(gameWorld.GrenadesCriticalStates);
WorldPacket.ArtilleryPackets.AddRange(gameWorld.ArtilleryProjectilesStates);

if (WorldPacket.HasData)
{
server.SendReusableToAll(ref WorldPacket, DeliveryMethod.ReliableOrdered);
WorldPacket.Flush();
}

gameWorld.GrenadesCriticalStates.Clear();
gameWorld.ArtilleryProjectilesStates.Clear();
}

public void UpdateLootItems(GClass786<int, LootItem> lootItems)
Expand Down

0 comments on commit 6102743

Please sign in to comment.