Багфиксы (#92)
* - fix: Fix airlock draw depth. * - fix: Fix headrev command staff message. * - fix: Fix gulag bound antags. * - fix: Double health icon fix. * - fix: Fix cult start exception. * - fix: Fix cult pull teleport. * - fix: Fix another exception. * - fix: Fix drawdepth again. * - fix: Clown font fix.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Linq;
|
||||
using Content.Server._Miracle.Components;
|
||||
using Content.Server.Actions;
|
||||
using Content.Server.Chat.Managers;
|
||||
using Content.Server.GameTicking;
|
||||
@@ -326,6 +327,11 @@ public sealed class CultRuleSystem : GameRuleSystem<CultRuleComponent>
|
||||
if (!_jobSystem.CanBeAntag(player))
|
||||
continue;
|
||||
|
||||
// Gulag
|
||||
if (!_mindSystem.TryGetMind(player, out _, out var mind) ||
|
||||
mind.OwnedEntity is not { } ownedEntity || HasComp<GulagBoundComponent>(ownedEntity))
|
||||
continue;
|
||||
|
||||
// Latejoin
|
||||
if (player.AttachedEntity != null && pendingQuery.HasComponent(player.AttachedEntity.Value))
|
||||
continue;
|
||||
@@ -349,6 +355,7 @@ public sealed class CultRuleSystem : GameRuleSystem<CultRuleComponent>
|
||||
{
|
||||
_sawmill.Info("Insufficient preferred cultists, picking at random.");
|
||||
prefList = list;
|
||||
return prefList;
|
||||
}
|
||||
|
||||
if (prefList.Count >= _minimalCultists)
|
||||
@@ -375,15 +382,16 @@ public sealed class CultRuleSystem : GameRuleSystem<CultRuleComponent>
|
||||
private List<ICommonSession> PickCultists(List<ICommonSession> prefList)
|
||||
{
|
||||
var result = new List<ICommonSession>();
|
||||
if (prefList.Count == 0)
|
||||
|
||||
var minCultists = _cfg.GetCVar(WhiteCVars.CultMinPlayers);
|
||||
var maxCultists = _cfg.GetCVar(WhiteCVars.CultMaxStartingPlayers);
|
||||
|
||||
if (prefList.Count < minCultists)
|
||||
{
|
||||
_sawmill.Info("Insufficient ready players to fill up with cultists, stopping the selection.");
|
||||
return result;
|
||||
}
|
||||
|
||||
var minCultists = _cfg.GetCVar(WhiteCVars.CultMinPlayers);
|
||||
var maxCultists = _cfg.GetCVar(WhiteCVars.CultMaxStartingPlayers);
|
||||
|
||||
var actualCultistCount = prefList.Count > maxCultists ? maxCultists : minCultists;
|
||||
|
||||
for (var i = 0; i < actualCultistCount; i++)
|
||||
|
||||
@@ -33,6 +33,7 @@ using Content.Shared._White.Cult.Components;
|
||||
using Content.Shared._White.Cult.Runes;
|
||||
using Content.Shared._White.Cult.UI;
|
||||
using Content.Shared.Mindshield.Components;
|
||||
using Content.Shared.Pulling;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Components;
|
||||
@@ -62,6 +63,7 @@ public sealed partial class CultSystem : EntitySystem
|
||||
[Dependency] private readonly GunSystem _gunSystem = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly FlammableSystem _flammableSystem = default!;
|
||||
[Dependency] private readonly SharedPullingSystem _pulling = default!;
|
||||
|
||||
|
||||
public override void Initialize()
|
||||
@@ -664,6 +666,18 @@ public sealed partial class CultSystem : EntitySystem
|
||||
|
||||
foreach (var target in targets)
|
||||
{
|
||||
// break pulls before portal enter so we dont break shit
|
||||
if (TryComp<SharedPullableComponent>(target, out var pullable) && pullable.BeingPulled)
|
||||
{
|
||||
_pulling.TryStopPull(pullable);
|
||||
}
|
||||
|
||||
if (TryComp<SharedPullerComponent>(target, out var pulling)
|
||||
&& pulling.Pulling != null && TryComp<SharedPullableComponent>(pulling.Pulling.Value, out var subjectPulling))
|
||||
{
|
||||
_pulling.TryStopPull(subjectPulling);
|
||||
}
|
||||
|
||||
_xform.SetCoordinates(target, xFormSelected.Coordinates);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ using Content.Shared.Actions;
|
||||
using Content.Shared.Eui;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared._White.Cult.UI;
|
||||
using Content.Shared.Pulling;
|
||||
using Content.Shared.Pulling.Components;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Timing;
|
||||
@@ -15,6 +17,7 @@ public sealed class TeleportSpellEui : BaseEui
|
||||
{
|
||||
[Dependency] private readonly EntityManager _entityManager = default!;
|
||||
private SharedTransformSystem _transformSystem;
|
||||
private SharedPullingSystem _pulling;
|
||||
private PopupSystem _popupSystem;
|
||||
|
||||
|
||||
@@ -32,6 +35,7 @@ public sealed class TeleportSpellEui : BaseEui
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
_transformSystem = _entityManager.System<SharedTransformSystem>();
|
||||
_pulling = _entityManager.System<SharedPullingSystem>();
|
||||
_popupSystem = _entityManager.System<PopupSystem>();
|
||||
|
||||
_performer = performer;
|
||||
@@ -97,6 +101,19 @@ public sealed class TeleportSpellEui : BaseEui
|
||||
|
||||
_used = true;
|
||||
|
||||
// break pulls before portal enter so we dont break shit
|
||||
if (_entityManager.TryGetComponent<SharedPullableComponent>(_target, out var pullable) && pullable.BeingPulled)
|
||||
{
|
||||
_pulling.TryStopPull(pullable);
|
||||
}
|
||||
|
||||
if (_entityManager.TryGetComponent<SharedPullerComponent>(_target, out var pulling)
|
||||
&& pulling.Pulling != null &&
|
||||
_entityManager.TryGetComponent<SharedPullableComponent>(pulling.Pulling.Value, out var subjectPulling))
|
||||
{
|
||||
_pulling.TryStopPull(subjectPulling);
|
||||
}
|
||||
|
||||
_transformSystem.SetCoordinates(_target, runeTransform.Coordinates);
|
||||
Close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user