Skip to content

Commit

Permalink
Fix wrong references after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Reousa committed Jan 10, 2024
1 parent 6965525 commit 37bbccb
Showing 1 changed file with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Reflection;
using System.Reflection.Emit;
using HarmonyLib;
using NebulaAPI.Extensions;
using NebulaAPI.GameState;
using NebulaModel;
using NebulaModel.Logger;
Expand Down Expand Up @@ -104,19 +105,14 @@ private static void AddPlayerSandCount(TrashSystem trashSystem, int trashId, int
{
if (Multiplayer.IsActive && !Config.Options.SyncSoil) // Host
{
using (Multiplayer.Session.Network.PlayerManager.GetConnectedPlayers(out var connectedPlayers))
var connectedPlayers = Multiplayer.Session.Server.Players.Connected();
var totalPlayerCount = connectedPlayers.Count + (Multiplayer.IsDedicated ? 0 : 1);
if (totalPlayerCount > 0)
{
var totalPlayerCount = connectedPlayers.Count + (Multiplayer.IsDedicated ? 0 : 1);
if (totalPlayerCount > 0)
{
// Sand gain is split between all connecting players
sandCount = (int)((float)sandCount / totalPlayerCount + 0.5f);
var packet = new PlayerSandCount(sandCount, true);
foreach (var kvp in connectedPlayers)
{
kvp.Value.SendPacket(packet);
}
}
// Sand gain is split between all connecting players
sandCount = (int)((float)sandCount / totalPlayerCount + 0.5f);
var packet = new PlayerSandCount(sandCount, true);
Multiplayer.Session.Server.SendTo(connectedPlayers, packet);
}
}

Expand Down

0 comments on commit 37bbccb

Please sign in to comment.