Багфиксы (#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:
Aviu00
2024-02-18 17:30:52 +09:00
committed by GitHub
parent 9caa5a408b
commit 57d57939f7
11 changed files with 67 additions and 8 deletions

View File

@@ -10,11 +10,13 @@ using Content.Server.Mind;
using Robust.Shared.Random;
using Robust.Shared.Map;
using System.Numerics;
using Content.Server._Miracle.Components;
using Content.Shared.Inventory;
using Content.Server.Storage.EntitySystems;
using Robust.Shared.Audio;
using Content.Server.Chat.Managers;
using Content.Server.GameTicking;
using Content.Server.Revolutionary.Components;
using Content.Server.Roles;
using Robust.Shared.Containers;
using Content.Shared.Mobs.Components;
@@ -102,6 +104,13 @@ public sealed class AntagSelectionSystem : GameRuleSystem<GameRuleComponent>
{
if (includeHeads == false)
{
// WD START
if (!_mindSystem.TryGetMind(player, out _, out var mind) ||
mind.OwnedEntity is not { } ownedEntity || HasComp<CommandStaffComponent>(ownedEntity) ||
HasComp<GulagBoundComponent>(ownedEntity))
continue;
// WD END
if (!_jobs.CanBeAntag(player))
continue;
}
@@ -173,6 +182,11 @@ public sealed class AntagSelectionSystem : GameRuleSystem<GameRuleComponent>
if (!_jobs.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;

View File

@@ -156,7 +156,6 @@ public sealed class RevolutionaryRuleSystem : GameRuleSystem<RevolutionaryRuleCo
{
_antagSelection.EligiblePlayers(comp.HeadRevPrototypeId, comp.MaxHeadRevs, comp.PlayersPerHeadRev, comp.HeadRevStartSound,
"head-rev-role-greeting", "#5e9cff", out var chosen);
chosen = chosen.Where(x => !HasComp<CommandStaffComponent>(x)).ToList(); // WD
if (chosen.Any())
GiveHeadRev(chosen, comp.HeadRevPrototypeId, comp);
else

View File

@@ -1,5 +1,6 @@
using System.Globalization;
using System.Linq;
using Content.Server._Miracle.Components;
using Content.Server.Actions;
using Content.Server.Chat.Managers;
using Content.Server.Chat.Systems;
@@ -274,6 +275,9 @@ public sealed class ZombieRuleSystem : GameRuleSystem<ZombieRuleComponent>
if (player.AttachedEntity == null || !HasComp<HumanoidAppearanceComponent>(player.AttachedEntity) || HasComp<ZombieImmuneComponent>(player.AttachedEntity))
continue;
if (HasComp<GulagBoundComponent>(player.AttachedEntity)) // WD
continue;
if (HasComp<InitialInfectedExemptComponent>(player.AttachedEntity))
continue; // used (for example) on ERT

View File

@@ -44,7 +44,7 @@ public sealed class RadioSystem : EntitySystem
{
if (args.Channel != null && component.Channels.Contains(args.Channel.ID))
{
SendRadioMessage(uid, args.Message, args.Channel, uid);
SendRadioMessage(uid, args.Message, args.Channel, uid, false); // WD EDIT
args.Channel = null; // prevent duplicate messages from other listeners.
}
}

View File

@@ -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++)

View File

@@ -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);
}

View File

@@ -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();
}