Gateway destinations (#21040)
* Gateway generation * Gateway stuff * gatewehs * mercenaries * play area * Range fixes and tweaks * weh * Gateway UI polish * Lots of fixes * Knock some items off * Fix dungeon spawning Realistically we should probably be using a salvage job. * wahwah * wehvs * expression * weh * eee * a * a * WEH * frfr * Gatwey * Fix gateway windows * Fix gateway windows * a * a * Better layer masking * a * a * Noise fixes * a * Fix fractal calculations * a * More fixes * Fixes * Add layers back in * Fixes * namespaces and ftl * Other TODO * Fix distance * Cleanup * Fix test
This commit is contained in:
@@ -54,13 +54,29 @@ public sealed class LinkedEntitySystem : EntitySystem
|
||||
_appearance.SetData(first, LinkedEntityVisuals.HasAnyLinks, true);
|
||||
_appearance.SetData(second, LinkedEntityVisuals.HasAnyLinks, true);
|
||||
|
||||
Dirty(firstLink);
|
||||
Dirty(secondLink);
|
||||
Dirty(first, firstLink);
|
||||
Dirty(second, secondLink);
|
||||
|
||||
return firstLink.LinkedEntities.Add(second)
|
||||
&& secondLink.LinkedEntities.Add(first);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Does a one-way link from source to target.
|
||||
/// </summary>
|
||||
/// <param name="deleteOnEmptyLinks">Whether both entities should now delete once their links are removed</param>
|
||||
public bool OneWayLink(EntityUid source, EntityUid target, bool deleteOnEmptyLinks=false)
|
||||
{
|
||||
var firstLink = EnsureComp<LinkedEntityComponent>(source);
|
||||
firstLink.DeleteOnEmptyLinks = deleteOnEmptyLinks;
|
||||
|
||||
_appearance.SetData(source, LinkedEntityVisuals.HasAnyLinks, true);
|
||||
|
||||
Dirty(source, firstLink);
|
||||
|
||||
return firstLink.LinkedEntities.Add(target);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Unlinks two entities. Deletes either entity if <see cref="LinkedEntityComponent.DeleteOnEmptyLinks"/>
|
||||
/// was true and its links are now empty. Symmetrical, so order doesn't matter.
|
||||
|
||||
Reference in New Issue
Block a user