Disallow bible healing if target is dead (#8999)
This commit is contained in:
@@ -92,7 +92,9 @@ namespace Content.Server.Bible
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (args.Target == null || args.Target == args.User || !HasComp<MobStateComponent>(args.Target))
|
|
||||||
|
if (args.Target == null || args.Target == args.User || !TryComp<MobStateComponent>(args.Target, out var mobState)
|
||||||
|
|| mobState.IsDead())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -112,7 +114,7 @@ namespace Content.Server.Bible
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This only has a chance to fail if the target is not wearing anything on their head and is not a familiar.
|
// This only has a chance to fail if the target is not wearing anything on their head and is not a familiar.
|
||||||
if (!_invSystem.TryGetSlotEntity(args.Target.Value, "head", out var entityUid) && !HasComp<FamiliarComponent>(args.Target.Value))
|
if (!_invSystem.TryGetSlotEntity(args.Target.Value, "head", out var _) && !HasComp<FamiliarComponent>(args.Target.Value))
|
||||||
{
|
{
|
||||||
if (_random.Prob(component.FailChance))
|
if (_random.Prob(component.FailChance))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user