Files
Nitrox/NitroxServer/Communication/Packets/Processors/PlayerSeeOutOfCellEntityProcessor.cs
2025-07-06 00:23:46 +02:00

24 lines
730 B
C#

using NitroxModel.Packets;
using NitroxServer.Communication.Packets.Processors.Abstract;
using NitroxServer.GameLogic.Entities;
namespace NitroxServer.Communication.Packets.Processors;
public class PlayerSeeOutOfCellEntityProcessor : AuthenticatedPacketProcessor<PlayerSeeOutOfCellEntity>
{
private readonly EntityRegistry entityRegistry;
public PlayerSeeOutOfCellEntityProcessor(EntityRegistry entityRegistry)
{
this.entityRegistry = entityRegistry;
}
public override void Process(PlayerSeeOutOfCellEntity packet, Player player)
{
if (entityRegistry.GetEntityById(packet.EntityId).HasValue)
{
player.OutOfCellVisibleEntities.Add(packet.EntityId);
}
}
}