Fix errors

This commit is contained in:
DrSmugleaf
2021-12-05 21:02:04 +01:00
parent 2a3b7d809d
commit ab9d0cc6d8
94 changed files with 568 additions and 591 deletions

View File

@@ -57,8 +57,8 @@ namespace Content.Server.Objectives.Conditions
{
get
{
if (_mind?.OwnedEntity == null) return 0f;
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<ContainerManagerComponent?>(_mind.OwnedEntity, out var containerManagerComponent)) return 0f;
if (_mind?.OwnedEntity is not {Valid: true} owned) return 0f;
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<ContainerManagerComponent?>(owned, out var containerManagerComponent)) return 0f;
float count = containerManagerComponent.CountPrototypeOccurencesRecursive(_prototypeId);
return count/_amount;