From 610274314177e24e838932b7cdc6cc624312b4e1 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Sun, 22 Dec 2024 20:47:21 +0100 Subject: [PATCH] Revamp sending of WorldPacket --- Fika.Core/Coop/HostClasses/FikaHostWorld.cs | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/Fika.Core/Coop/HostClasses/FikaHostWorld.cs b/Fika.Core/Coop/HostClasses/FikaHostWorld.cs index 512c2abc..cdaf466e 100644 --- a/Fika.Core/Coop/HostClasses/FikaHostWorld.cs +++ b/Fika.Core/Coop/HostClasses/FikaHostWorld.cs @@ -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 lootItems)