Skip to content

Commit

Permalink
Fix simulation ownership not being given when first placing interior …
Browse files Browse the repository at this point in the history
…pieces (water parks, reactors ...)
  • Loading branch information
tornac1234 committed May 4, 2024
1 parent e74e6ab commit 247060e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
using NitroxModel.DataStructures.GameLogic.Entities;
using NitroxModel.Packets;
using NitroxServer.GameLogic;
using NitroxServer.GameLogic.Bases;
using NitroxServer.GameLogic.Entities;

namespace NitroxServer.Communication.Packets.Processors;

public class UpdateBaseProcessor : BuildingProcessor<UpdateBase>
{
public UpdateBaseProcessor(BuildingManager buildingManager, PlayerManager playerManager) : base(buildingManager, playerManager) { }
public UpdateBaseProcessor(BuildingManager buildingManager, PlayerManager playerManager, EntitySimulation entitySimulation) : base(buildingManager, playerManager, entitySimulation) { }

public override void Process(UpdateBase packet, Player player)
{
if (buildingManager.UpdateBase(player, packet, out int operationId))
{
if (packet.BuiltPieceEntity is GlobalRootEntity entity)
{
ClaimBuildPiece(entity, player);
}
// End-players can process elementary operations without this data (packet would be heavier for no reason)
packet.Deflate();
SendToOtherPlayersWithOperationId(packet, player, operationId);
Expand Down

0 comments on commit 247060e

Please sign in to comment.