]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Update SmokingSystem.SmokingPipe.cs to not use Component.Owner (#29967)
authorPlykiya <58439124+Plykiya@users.noreply.github.com>
Sat, 13 Jul 2024 04:06:54 +0000 (21:06 -0700)
committerGitHub <noreply@github.com>
Sat, 13 Jul 2024 04:06:54 +0000 (14:06 +1000)
Update SmokingSystem.SmokingPipe.cs

Co-authored-by: plykiya <plykiya@protonmail.com>
Content.Server/Nutrition/EntitySystems/SmokingSystem.SmokingPipe.cs

index 3950c73eb43e240d966bfe6beb5051dc5e4679d8..26d86acd5450b16b3aa0002bb84f3edce412576d 100644 (file)
@@ -42,7 +42,7 @@ namespace Content.Server.Nutrition.EntitySystems
             if (!isHotEvent.IsHot)
                 return;
 
-            if (TryTransferReagents(entity.Comp, smokable))
+            if (TryTransferReagents(entity, (entity.Owner, smokable)))
                 SetSmokableState(entity, SmokableState.Lit, smokable);
             args.Handled = true;
         }
@@ -62,7 +62,7 @@ namespace Content.Server.Nutrition.EntitySystems
             if (!isHotEvent.IsHot)
                 return;
 
-            if (TryTransferReagents(entity.Comp, smokable))
+            if (TryTransferReagents(entity, (entity.Owner, smokable)))
                 SetSmokableState(entity, SmokableState.Lit, smokable);
             args.Handled = true;
         }
@@ -74,15 +74,15 @@ namespace Content.Server.Nutrition.EntitySystems
         }
 
         // Convert smokable item into reagents to be smoked
-        private bool TryTransferReagents(SmokingPipeComponent component, SmokableComponent smokable)
+        private bool TryTransferReagents(Entity<SmokingPipeComponent> entity, Entity<SmokableComponent> smokable)
         {
-            if (component.BowlSlot.Item == null)
+            if (entity.Comp.BowlSlot.Item == null)
                 return false;
 
-            EntityUid contents = component.BowlSlot.Item.Value;
+            EntityUid contents = entity.Comp.BowlSlot.Item.Value;
 
             if (!TryComp<SolutionContainerManagerComponent>(contents, out var reagents) ||
-                !_solutionContainerSystem.TryGetSolution(smokable.Owner, smokable.Solution, out var pipeSolution, out _))
+                !_solutionContainerSystem.TryGetSolution(smokable.Owner, smokable.Comp.Solution, out var pipeSolution, out _))
                 return false;
 
             foreach (var (_, soln) in _solutionContainerSystem.EnumerateSolutions((contents, reagents)))
@@ -93,7 +93,7 @@ namespace Content.Server.Nutrition.EntitySystems
 
             EntityManager.DeleteEntity(contents);
 
-            _itemSlotsSystem.SetLock(component.Owner, component.BowlSlot, true); //no inserting more until current runs out
+            _itemSlotsSystem.SetLock(entity.Owner, entity.Comp.BowlSlot, true); //no inserting more until current runs out
 
             return true;
         }