public override void ServerOnDestroy(IDynamicWorldObject gameObject) { base.ServerOnDestroy(gameObject); // try drop extra containers on the ground var privateState = GetPrivateState(gameObject); DropItemsToTheGround(privateState.EquipmentItemsContainer); //DropItemsToTheGround(privateState.FuelItemsContainer); // consider fuel items were destroyed during the explosion void DropItemsToTheGround(IItemsContainer itemsContainer) { if (itemsContainer?.OccupiedSlotsCount == 0) { return; } var groundContainer = ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent( gameObject.Tile, itemsContainer); if (groundContainer != null) { // set custom timeout for the dropped ground items container ObjectGroundItemsContainer.ServerSetDestructionTimeout( (IStaticWorldObject)groundContainer.Owner, DestroyedCargoDroppedItemsDestructionTimeout.TotalSeconds); } } }
public override void ServerOnDestroy(IStaticWorldObject gameObject) { base.ServerOnDestroy(gameObject); LandClaimSystem.ServerOnObjectLandClaimDestroyed(gameObject); // try drop items from the safe storage var itemsContainer = GetPrivateState(gameObject).ItemsContainer; if (itemsContainer.OccupiedSlotsCount == 0) { // no items to drop return; } var groundContainer = ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent( gameObject.OccupiedTile, itemsContainer); if (groundContainer == null) { // no items dropped return; } // set custom timeout for the dropped ground items container ObjectGroundItemsContainer.ServerSetDestructionTimeout( (IStaticWorldObject)groundContainer.Owner, DestroyedLandClaimDroppedItemsDestructionTimeout.TotalSeconds); }
public override void ServerOnDestroy(IStaticWorldObject gameObject) { base.ServerOnDestroy(gameObject); ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent( gameObject.OccupiedTile, GetPrivateState(gameObject).InputItemsCointainer); }
public override void ServerOnDestroy(IStaticWorldObject gameObject) { base.ServerOnDestroy(gameObject); ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent( gameObject.OccupiedTile, GetPrivateState(gameObject).ItemsContainer, destroyTimeout: DestroyedCrateDroppedItemsDestructionTimeout.TotalSeconds); }
public static void ServerOnDestroy(IStaticWorldObject tradingStation) { TradingStationsMapMarksSystem.ServerTryRemoveMark(tradingStation); var itemsContainer = GetPrivateState(tradingStation).StockItemsContainer; ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent( tradingStation.OccupiedTile, itemsContainer, DestroyedTradingStationDroppedItemsDestructionTimeout.TotalSeconds); }
public override void ServerOnDestroy(IStaticWorldObject gameObject) { base.ServerOnDestroy(gameObject); var itemsContainer = GetPrivateState(gameObject).ItemsContainer; if (itemsContainer.OccupiedSlotsCount > 0) { ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent( gameObject.OccupiedTile, itemsContainer); } }
public override void ServerOnDestroy(IDynamicWorldObject gameObject) { base.ServerOnDestroy(gameObject); // try drop extra containers on the ground var privateState = GetPrivateState(gameObject); ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent( gameObject.Tile, privateState.EquipmentItemsContainer, DestroyedCargoDroppedItemsDestructionTimeout.TotalSeconds); // consider fuel items were destroyed during the explosion }
public override void ServerOnDestroy(IStaticWorldObject gameObject) { base.ServerOnDestroy(gameObject); var stateGasoline = GetPrivateState(gameObject).ManufacturingStateGasoline; ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent( gameObject.OccupiedTile, stateGasoline.ContainerInput); ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent( gameObject.OccupiedTile, stateGasoline.ContainerOutput); }
public override void ServerOnDestroy(IStaticWorldObject gameObject) { base.ServerOnDestroy(gameObject); foreach (var reactorState in GetPrivateState(gameObject).ReactorStates) { if (reactorState?.ItemsContainer is null) { continue; } ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent( gameObject.OccupiedTile, reactorState.ItemsContainer); } }
public override void ServerOnDestroy(IStaticWorldObject gameObject) { base.ServerOnDestroy(gameObject); var privateState = GetPrivateState(gameObject); ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent( gameObject.OccupiedTile, privateState.ManufacturingState?.ContainerInput); ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent( gameObject.OccupiedTile, privateState.ManufacturingState?.ContainerOutput); ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent( gameObject.OccupiedTile, privateState.FuelBurningState?.ContainerFuel); }
public override void ServerOnDestroy(IStaticWorldObject gameObject) { base.ServerOnDestroy(gameObject); var itemsContainer = GetPrivateState(gameObject).ItemsContainer; if (itemsContainer.OccupiedSlotsCount == 0) { return; } var groundContainer = ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent( gameObject.OccupiedTile, itemsContainer); if (groundContainer != null) { // set custom timeout for the dropped ground items container ObjectGroundItemsContainer.ServerSetDestructionTimeout( (IStaticWorldObject)groundContainer.Owner, DestroyedCrateDroppedItemsDestructionTimeout.TotalSeconds); } }
public static void ServerOnDestroy(IStaticWorldObject tradingStation) { TradingStationsMapMarksSystem.ServerTryRemoveMark(tradingStation); var itemsContainer = GetPrivateState(tradingStation).StockItemsContainer; if (itemsContainer.OccupiedSlotsCount == 0) { return; } var groundContainer = ObjectGroundItemsContainer.ServerTryDropOnGroundContainerContent( tradingStation.OccupiedTile, itemsContainer); if (groundContainer != null) { // set custom timeout for the dropped ground items container ObjectGroundItemsContainer.ServerSetDestructionTimeout( (IStaticWorldObject)groundContainer.Owner, DestroyedTradingStationDroppedItemsDestructionTimeout.TotalSeconds); } }