Borgs (#18136)
* Laws * positronic brain and PAI rewrite * MMI * MMI pt. 2 * borg brain transfer * Roleban support, Borg job (WIP), the end of mind shenaniganry * battery drain, item slot cleanup, alerts * visuals * fix this pt1 * fix this pt2 * Modules, Lingering Stacks, Better borg flashlight * Start on UI, fix battery alerts, expand activation/deactivation, low movement speed on no power. * sprotes * no zombie borgs * oh fuck yeah i love a good relay * charger * fix the tiniest of sprite issues * adjustable names * a functional UI???? * foobar * more modules * this shit for some reason * upstream * genericize selectable borg modules * upstream again * holy fucking shit * i love christ * proper construction * da job * AA borgs * and boom more shit * admin logs * laws redux * ok just do this rq * oh boy that looks like modules * oh shit research * testos passo * so much shit holy fuck * fuckit we SHIP * last minute snags * should've gotten me on a better day
This commit is contained in:
@@ -27,11 +27,11 @@ public sealed class MindSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly GameTicker _gameTicker = default!;
|
||||
[Dependency] private readonly ActorSystem _actor = default!;
|
||||
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
|
||||
[Dependency] private readonly GhostSystem _ghostSystem = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly ActorSystem _actor = default!;
|
||||
|
||||
// This is dictionary is required to track the minds of disconnected players that may have had their entity deleted.
|
||||
private readonly Dictionary<NetUserId, Mind> _userMinds = new();
|
||||
@@ -128,8 +128,8 @@ public sealed class MindSystem : EntitySystem
|
||||
if (!Resolve(uid, ref mind, false))
|
||||
return;
|
||||
|
||||
RaiseLocalEvent(uid, new MindRemovedMessage(), true);
|
||||
mind.Mind = null;
|
||||
RaiseLocalEvent(uid, new MindRemovedMessage(), true);
|
||||
}
|
||||
|
||||
private void OnVisitingTerminating(EntityUid uid, VisitingMindComponent component, ref EntityTerminatingEvent args)
|
||||
@@ -414,10 +414,6 @@ public sealed class MindSystem : EntitySystem
|
||||
InternalEjectMind(oldEntity.Value, oldComp);
|
||||
|
||||
SetOwnedEntity(mind, entity, component);
|
||||
if (mind.OwnedComponent != null){
|
||||
InternalAssignMind(mind.OwnedEntity!.Value, mind, mind.OwnedComponent);
|
||||
mind.OriginalOwnedEntity ??= mind.OwnedEntity;
|
||||
}
|
||||
|
||||
// Don't do the full deletion cleanup if we're transferring to our VisitingEntity
|
||||
if (alreadyAttached)
|
||||
@@ -438,9 +434,15 @@ public sealed class MindSystem : EntitySystem
|
||||
// Player is CURRENTLY connected.
|
||||
if (mind.Session != null && !alreadyAttached && mind.VisitingEntity == null)
|
||||
{
|
||||
mind.Session.AttachToEntity(entity);
|
||||
_actor.Attach(entity, mind.Session, true);
|
||||
Log.Info($"Session {mind.Session.Name} transferred to entity {entity}.");
|
||||
}
|
||||
|
||||
if (mind.OwnedComponent != null)
|
||||
{
|
||||
InternalAssignMind(mind.OwnedEntity!.Value, mind, mind.OwnedComponent);
|
||||
mind.OriginalOwnedEntity ??= mind.OwnedEntity;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -559,7 +561,7 @@ public sealed class MindSystem : EntitySystem
|
||||
public bool TryGetMind(EntityUid uid, [NotNullWhen(true)] out Mind? mind, MindContainerComponent? mindContainerComponent = null)
|
||||
{
|
||||
mind = null;
|
||||
if (!Resolve(uid, ref mindContainerComponent))
|
||||
if (!Resolve(uid, ref mindContainerComponent, false))
|
||||
return false;
|
||||
|
||||
if (!mindContainerComponent.HasMind)
|
||||
|
||||
Reference in New Issue
Block a user