Remove obsolete code from Food, Drink and Respirator systems. (#30560)
* Remove obsolete code from Food, Drink and Respirator systems * remove obsolete comment
This commit is contained in:
@@ -258,7 +258,7 @@ public sealed class DrinkSystem : SharedDrinkSystem
|
||||
if (transferAmount <= 0)
|
||||
return;
|
||||
|
||||
if (!_body.TryGetBodyOrganComponents<StomachComponent>(args.Target.Value, out var stomachs, body))
|
||||
if (!_body.TryGetBodyOrganEntityComps<StomachComponent>((args.Target.Value, body), out var stomachs))
|
||||
{
|
||||
_popup.PopupEntity(Loc.GetString(forceDrink ? "drink-component-try-use-drink-cannot-drink-other" : "drink-component-try-use-drink-had-enough"), args.Target.Value, args.User);
|
||||
|
||||
@@ -272,7 +272,7 @@ public sealed class DrinkSystem : SharedDrinkSystem
|
||||
return;
|
||||
}
|
||||
|
||||
var firstStomach = stomachs.FirstOrNull(stomach => _stomach.CanTransferSolution(stomach.Comp.Owner, drained, stomach.Comp));
|
||||
var firstStomach = stomachs.FirstOrNull(stomach => _stomach.CanTransferSolution(stomach.Owner, drained, stomach.Comp1));
|
||||
|
||||
//All stomachs are full or can't handle whatever solution we have.
|
||||
if (firstStomach == null)
|
||||
@@ -321,8 +321,7 @@ public sealed class DrinkSystem : SharedDrinkSystem
|
||||
_audio.PlayPvs(entity.Comp.UseSound, args.Target.Value, AudioParams.Default.WithVolume(-2f));
|
||||
|
||||
_reaction.DoEntityReaction(args.Target.Value, solution, ReactionMethod.Ingestion);
|
||||
//TODO: Grab the stomach UIDs somehow without using Owner
|
||||
_stomach.TryTransferSolution(firstStomach.Value.Comp.Owner, drained, firstStomach.Value.Comp);
|
||||
_stomach.TryTransferSolution(firstStomach.Value.Owner, drained, firstStomach.Value.Comp1);
|
||||
|
||||
_forensics.TransferDna(entity, args.Target.Value);
|
||||
|
||||
@@ -336,7 +335,7 @@ public sealed class DrinkSystem : SharedDrinkSystem
|
||||
!ev.CanInteract ||
|
||||
!ev.CanAccess ||
|
||||
!TryComp<BodyComponent>(ev.User, out var body) ||
|
||||
!_body.TryGetBodyOrganComponents<StomachComponent>(ev.User, out var stomachs, body))
|
||||
!_body.TryGetBodyOrganEntityComps<StomachComponent>((ev.User, body), out var stomachs))
|
||||
return;
|
||||
|
||||
// Make sure the solution exists
|
||||
|
||||
Reference in New Issue
Block a user