Fix errors
This commit is contained in:
@@ -20,10 +20,10 @@ namespace Content.Server.Objectives.Conditions
|
||||
if (Target == null)
|
||||
return Loc.GetString("objective-condition-kill-person-title", ("targetName", targetName));
|
||||
|
||||
if(Target.CharacterName != null)
|
||||
if (Target.CharacterName != null)
|
||||
targetName = Target.CharacterName;
|
||||
else if (Target.OwnedEntity != null)
|
||||
targetName = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Target.OwnedEntity).EntityName;
|
||||
else if (Target.OwnedEntity is {Valid: true} owned)
|
||||
targetName = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(owned).EntityName;
|
||||
|
||||
return Loc.GetString("objective-condition-kill-person-title", ("targetName", targetName));
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user