Inline UID
This commit is contained in:
@@ -23,7 +23,7 @@ namespace Content.Server.Objectives.Conditions
|
||||
if(Target.CharacterName != null)
|
||||
targetName = Target.CharacterName;
|
||||
else if (Target.OwnedEntity != null)
|
||||
targetName = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Target.OwnedEntity.Uid).EntityName;
|
||||
targetName = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Target.OwnedEntity).EntityName;
|
||||
|
||||
return Loc.GetString("objective-condition-kill-person-title", ("targetName", targetName));
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Content.Server.Objectives.Conditions
|
||||
if (entity == null)
|
||||
return false;
|
||||
|
||||
return (IoCManager.Resolve<IEntityManager>().GetComponentOrNull<MobStateComponent>(entity.Uid)?.IsAlive() ?? false) && mc.Mind != mind;
|
||||
return (IoCManager.Resolve<IEntityManager>().GetComponentOrNull<MobStateComponent>(entity)?.IsAlive() ?? false) && mc.Mind != mind;
|
||||
}).Select(mc => mc.Mind).ToList();
|
||||
return new KillRandomPersonCondition {Target = IoCManager.Resolve<IRobustRandom>().Pick(allHumans)};
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace Content.Server.Objectives.Conditions
|
||||
get
|
||||
{
|
||||
if (_mind?.OwnedEntity == null) return 0f;
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<ContainerManagerComponent?>(_mind.OwnedEntity.Uid, out var containerManagerComponent)) return 0f;
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<ContainerManagerComponent?>(_mind.OwnedEntity, out var containerManagerComponent)) return 0f;
|
||||
|
||||
float count = containerManagerComponent.CountPrototypeOccurencesRecursive(_prototypeId);
|
||||
return count/_amount;
|
||||
|
||||
Reference in New Issue
Block a user