Inline UID
This commit is contained in:
@@ -25,7 +25,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
{
|
||||
SoundSystem.Play(Filter.Pvs(creamPie.Owner), creamPie.Sound.GetSound(), creamPie.Owner, AudioHelpers.WithVariation(0.125f));
|
||||
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<FoodComponent?>(creamPie.Owner.Uid, out var foodComp) && _solutionsSystem.TryGetSolution(creamPie.Owner.Uid, foodComp.SolutionName, out var solution))
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<FoodComponent?>(creamPie.Owner, out var foodComp) && _solutionsSystem.TryGetSolution(creamPie.Owner, foodComp.SolutionName, out var solution))
|
||||
{
|
||||
solution.SpillAt(creamPie.Owner, "PuddleSmear", false);
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
if (!drink.Opened)
|
||||
{
|
||||
_popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-not-open",
|
||||
("owner", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(drink.Owner.Uid).EntityName)), uid, Filter.Entities(userUid));
|
||||
("owner", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(drink.Owner).EntityName)), uid, Filter.Entities(userUid));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
drinkSolution.DrainAvailable <= 0)
|
||||
{
|
||||
_popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-is-empty",
|
||||
("entity", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(drink.Owner.Uid).EntityName)), uid, Filter.Entities(userUid));
|
||||
("entity", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(drink.Owner).EntityName)), uid, Filter.Entities(userUid));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -324,7 +324,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
if (!drink.Opened)
|
||||
{
|
||||
_popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-not-open",
|
||||
("owner", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(drink.Owner.Uid).EntityName)), uid, Filter.Entities(userUid));
|
||||
("owner", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(drink.Owner).EntityName)), uid, Filter.Entities(userUid));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -332,7 +332,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
drinkSolution.DrainAvailable <= 0)
|
||||
{
|
||||
_popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-is-empty",
|
||||
("entity", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(drink.Owner.Uid).EntityName)), uid, Filter.Entities(userUid));
|
||||
("entity", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(drink.Owner).EntityName)), uid, Filter.Entities(userUid));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
private void DeleteAndSpawnTrash(FoodComponent component, EntityUid? userUid = null)
|
||||
{
|
||||
//We're empty. Become trash.
|
||||
var position = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner.Uid).Coordinates;
|
||||
var position = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).Coordinates;
|
||||
var finisher = IoCManager.Resolve<IEntityManager>().SpawnEntity(component.TrashPrototype, position);
|
||||
|
||||
// If the user is holding the item
|
||||
@@ -207,7 +207,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
EntityManager.DeleteEntity(component.OwnerUid);
|
||||
|
||||
// Put the trash in the user's hand
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(finisher.Uid, out ItemComponent? item) &&
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(finisher, out ItemComponent? item) &&
|
||||
handsComponent.CanPutInHand(item))
|
||||
{
|
||||
handsComponent.PutInHand(item);
|
||||
@@ -420,7 +420,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
foreach (var item in hands.GetAllHeldItems())
|
||||
{
|
||||
// Is utensil?
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(item.Owner.Uid, out UtensilComponent? utensil))
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(item.Owner, out UtensilComponent? utensil))
|
||||
continue;
|
||||
|
||||
if ((utensil.Types & component.Utensil) != 0 && // Acceptable type?
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
|
||||
private void OnThrowDoHit(EntityUid uid, ForcefeedOnCollideComponent component, ThrowDoHitEvent args)
|
||||
{
|
||||
_foodSystem.ProjectileForceFeed(uid, args.Target.Uid, args.User?.Uid);
|
||||
_foodSystem.ProjectileForceFeed(uid, args.Target, args.User);
|
||||
}
|
||||
|
||||
private void OnLand(EntityUid uid, ForcefeedOnCollideComponent component, LandEvent args)
|
||||
|
||||
@@ -57,7 +57,8 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
return false;
|
||||
}
|
||||
|
||||
var sliceUid = EntityManager.SpawnEntity(component.Slice, transform.Coordinates).Uid;
|
||||
IEntity tempQualifier = EntityManager.SpawnEntity(component.Slice, transform.Coordinates);
|
||||
var sliceUid = (EntityUid) tempQualifier;
|
||||
|
||||
var lostSolution = _solutionContainerSystem.SplitSolution(uid, solution,
|
||||
solution.CurrentVolume / FixedPoint2.New(component.Count));
|
||||
@@ -86,7 +87,8 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
|
||||
// Split last slice
|
||||
if (component.Count == 1) {
|
||||
var lastSlice = EntityManager.SpawnEntity(component.Slice, transform.Coordinates).Uid;
|
||||
IEntity tempQualifier1 = EntityManager.SpawnEntity(component.Slice, transform.Coordinates);
|
||||
var lastSlice = (EntityUid) tempQualifier1;
|
||||
|
||||
// Fill last slice with the rest of the solution
|
||||
FillSlice(lastSlice, solution);
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
return;
|
||||
|
||||
var isHotEvent = new IsHotEvent();
|
||||
RaiseLocalEvent(args.Used.Uid, isHotEvent, false);
|
||||
RaiseLocalEvent(args.Used, isHotEvent, false);
|
||||
|
||||
if (!isHotEvent.IsHot)
|
||||
return;
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
// This is awful. I hate this so much.
|
||||
// TODO: Please, someone refactor containers and free me from this bullshit.
|
||||
if (!smokable.Owner.TryGetContainerMan(out var containerManager) ||
|
||||
!IoCManager.Resolve<IEntityManager>().TryGetComponent(containerManager.Owner.Uid, out BloodstreamComponent? bloodstream))
|
||||
!IoCManager.Resolve<IEntityManager>().TryGetComponent(containerManager.Owner, out BloodstreamComponent? bloodstream))
|
||||
continue;
|
||||
|
||||
_reactiveSystem.ReactionEntity(containerManager.OwnerUid, ReactionMethod.Ingestion, inhaledSolution);
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
if (ev.Target == null)
|
||||
return;
|
||||
|
||||
if (TryUseUtensil(ev.UserUid, ev.Target.Uid, component))
|
||||
if (TryUseUtensil(ev.UserUid, ev.Target, component))
|
||||
ev.Handled = true;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
/// Attempt to break the utensil after interaction.
|
||||
/// </summary>
|
||||
/// <param name="uid">Utensil.</param>
|
||||
/// <param name="userUid">User of the utensil.</param>
|
||||
/// <param name="userUid">User of the utensil.</param>
|
||||
public void TryBreak(EntityUid uid, EntityUid userUid, UtensilComponent? component = null)
|
||||
{
|
||||
if (!Resolve(uid, ref component))
|
||||
@@ -70,7 +70,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
if (_robustRandom.Prob(component.BreakChance))
|
||||
{
|
||||
SoundSystem.Play(Filter.Pvs(userUid), component.BreakSound.GetSound(), userUid, AudioParams.Default.WithVolume(-2f));
|
||||
IoCManager.Resolve<IEntityManager>().DeleteEntity(component.Owner.Uid);
|
||||
IoCManager.Resolve<IEntityManager>().DeleteEntity((EntityUid) component.Owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user