]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Objects ordered through cargo system shouldn't start anchored (#28115)
authoreoineoineoin <github@eoinrul.es>
Sat, 25 May 2024 20:26:48 +0000 (21:26 +0100)
committerGitHub <noreply@github.com>
Sat, 25 May 2024 20:26:48 +0000 (16:26 -0400)
* Order normal space heater instead of anchored variant

* Make sure ordered objects don't spawn anchored

* Order space heater flatpack instead of a regular space heater

* Remove obsolete TODO

* Remove unnecessary name

---------

Co-authored-by: Eoin Mcloughlin <helloworld@eoinrul.es>
Content.Server/Cargo/Systems/CargoSystem.Orders.cs
Resources/Prototypes/Catalog/Cargo/cargo_engineering.yml
Resources/Prototypes/Catalog/Fills/Crates/engineering.yml
Resources/Prototypes/Catalog/Fills/Crates/engines.yml
Resources/Prototypes/Entities/Objects/Devices/flatpack.yml

index 63556d2fbd73dd7be22a51a90b37f62e8d4ff35f..c519362945e6428e92562cc4fc57d22593bba461 100644 (file)
@@ -20,6 +20,8 @@ namespace Content.Server.Cargo.Systems
 {
     public sealed partial class CargoSystem
     {
+        [Dependency] private readonly SharedTransformSystem _transformSystem = default!;
+
         /// <summary>
         /// How much time to wait (in seconds) before increasing bank accounts balance.
         /// </summary>
@@ -489,6 +491,9 @@ namespace Content.Server.Cargo.Systems
             // Create the item itself
             var item = Spawn(order.ProductId, spawn);
 
+            // Ensure the item doesn't start anchored
+            _transformSystem.Unanchor(item, Transform(item));
+
             // Create a sheet of paper to write the order details on
             var printed = EntityManager.SpawnEntity(paperProto, spawn);
             if (TryComp<PaperComponent>(printed, out var paper))
index 754e30f133a27352ed6da1a7adc94e09fd1d9195..7ca6af84518d53c511e48a34ada02112de37384d 100644 (file)
   icon:
     sprite: Structures/Piping/Atmospherics/Portable/portable_sheater.rsi
     state: sheaterOff
-  product: SpaceHeaterAnchored
+  product: CrateEngineeringSpaceHeater
   cost: 300
   category: cargoproduct-category-name-engineering
   group: market
index 03c870fa58087a398287a8e838900101ca1e889b..26a8910c735e95505a71b77df1dd660e446c43d9 100644 (file)
     contents:
     - id: WeaponParticleDecelerator
       amount: 3
+
+- type: entity
+  id: CrateEngineeringSpaceHeater
+  parent: CrateEngineering
+  name: space heater crate
+  description: Contains a space heater for climate control.
+  components:
+  - type: StorageFill
+    contents:
+      - id: SpaceHeaterFlatpack
index 79698b550a75d9e50b6c29dd74c3799da9fb61af..c37b7b7535a0171955aaf512dc469178971d1103 100644 (file)
@@ -42,7 +42,7 @@
   components:
   - type: StorageFill
     contents:
-      - id: EmitterFlatpack # TODO change to flatpack
+      - id: EmitterFlatpack
 
 - type: entity
   id: CrateEngineeringSingularityCollector
index 2aecd1328809f90f9e69a66a887be0c0c0ace711..e3e77d5c88ef47e4426a4fc64f8242ddeb0bca43 100644 (file)
     - state: overlay
       color: "#cec8ac"
     - state: icon-default
+
+- type: entity
+  parent: BaseFlatpack
+  id: SpaceHeaterFlatpack
+  name: space heater flatpack
+  description: A flatpack used for constructing a space heater.
+  components:
+  - type: Flatpack
+    entity: SpaceHeaterAnchored