C1984 (C4 nerf) (#7612)

This commit is contained in:
Alex Evgrashin
2022-04-24 03:22:14 +03:00
committed by GitHub
parent d6fc3d31c3
commit 8249185325
6 changed files with 42 additions and 6 deletions

View File

@@ -16,6 +16,13 @@ public sealed class StickyComponent : Component
[ViewVariables(VVAccess.ReadWrite)]
public EntityWhitelist? Whitelist;
/// <summary>
/// What target entities can't be used as surface for sticky entity.
/// </summary>
[DataField("blacklist")]
[ViewVariables(VVAccess.ReadWrite)]
public EntityWhitelist? Blacklist;
/// <summary>
/// How much time does it take to stick entity to target.
/// If zero will stick entity immediately.

View File

@@ -55,8 +55,12 @@ public sealed class StickySystem : EntitySystem
{
if (!Resolve(uid, ref component))
return false;
// check whitelist and blacklist
if (component.Whitelist != null && !component.Whitelist.IsValid(target))
return false;
if (component.Blacklist != null && component.Blacklist.IsValid(target))
return false;
// check if delay is not zero to start do after
var delay = (float) component.StickDelay.TotalSeconds;