Багфиксы (#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.Random;
using Robust.Shared.Map; using Robust.Shared.Map;
using System.Numerics; using System.Numerics;
using Content.Server._Miracle.Components;
using Content.Shared.Inventory; using Content.Shared.Inventory;
using Content.Server.Storage.EntitySystems; using Content.Server.Storage.EntitySystems;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Content.Server.Chat.Managers; using Content.Server.Chat.Managers;
using Content.Server.GameTicking; using Content.Server.GameTicking;
using Content.Server.Revolutionary.Components;
using Content.Server.Roles; using Content.Server.Roles;
using Robust.Shared.Containers; using Robust.Shared.Containers;
using Content.Shared.Mobs.Components; using Content.Shared.Mobs.Components;
@@ -102,6 +104,13 @@ public sealed class AntagSelectionSystem : GameRuleSystem<GameRuleComponent>
{ {
if (includeHeads == false) 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)) if (!_jobs.CanBeAntag(player))
continue; continue;
} }
@@ -173,6 +182,11 @@ public sealed class AntagSelectionSystem : GameRuleSystem<GameRuleComponent>
if (!_jobs.CanBeAntag(player)) if (!_jobs.CanBeAntag(player))
continue; continue;
// Gulag
if (!_mindSystem.TryGetMind(player, out _, out var mind) ||
mind.OwnedEntity is not { } ownedEntity || HasComp<GulagBoundComponent>(ownedEntity))
continue;
// Latejoin // Latejoin
if (player.AttachedEntity != null && pendingQuery.HasComponent(player.AttachedEntity.Value)) if (player.AttachedEntity != null && pendingQuery.HasComponent(player.AttachedEntity.Value))
continue; continue;

View File

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

View File

@@ -1,5 +1,6 @@
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
using Content.Server._Miracle.Components;
using Content.Server.Actions; using Content.Server.Actions;
using Content.Server.Chat.Managers; using Content.Server.Chat.Managers;
using Content.Server.Chat.Systems; 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)) if (player.AttachedEntity == null || !HasComp<HumanoidAppearanceComponent>(player.AttachedEntity) || HasComp<ZombieImmuneComponent>(player.AttachedEntity))
continue; continue;
if (HasComp<GulagBoundComponent>(player.AttachedEntity)) // WD
continue;
if (HasComp<InitialInfectedExemptComponent>(player.AttachedEntity)) if (HasComp<InitialInfectedExemptComponent>(player.AttachedEntity))
continue; // used (for example) on ERT 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)) 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. args.Channel = null; // prevent duplicate messages from other listeners.
} }
} }

View File

@@ -1,4 +1,5 @@
using System.Linq; using System.Linq;
using Content.Server._Miracle.Components;
using Content.Server.Actions; using Content.Server.Actions;
using Content.Server.Chat.Managers; using Content.Server.Chat.Managers;
using Content.Server.GameTicking; using Content.Server.GameTicking;
@@ -326,6 +327,11 @@ public sealed class CultRuleSystem : GameRuleSystem<CultRuleComponent>
if (!_jobSystem.CanBeAntag(player)) if (!_jobSystem.CanBeAntag(player))
continue; continue;
// Gulag
if (!_mindSystem.TryGetMind(player, out _, out var mind) ||
mind.OwnedEntity is not { } ownedEntity || HasComp<GulagBoundComponent>(ownedEntity))
continue;
// Latejoin // Latejoin
if (player.AttachedEntity != null && pendingQuery.HasComponent(player.AttachedEntity.Value)) if (player.AttachedEntity != null && pendingQuery.HasComponent(player.AttachedEntity.Value))
continue; continue;
@@ -349,6 +355,7 @@ public sealed class CultRuleSystem : GameRuleSystem<CultRuleComponent>
{ {
_sawmill.Info("Insufficient preferred cultists, picking at random."); _sawmill.Info("Insufficient preferred cultists, picking at random.");
prefList = list; prefList = list;
return prefList;
} }
if (prefList.Count >= _minimalCultists) if (prefList.Count >= _minimalCultists)
@@ -375,15 +382,16 @@ public sealed class CultRuleSystem : GameRuleSystem<CultRuleComponent>
private List<ICommonSession> PickCultists(List<ICommonSession> prefList) private List<ICommonSession> PickCultists(List<ICommonSession> prefList)
{ {
var result = new List<ICommonSession>(); 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."); _sawmill.Info("Insufficient ready players to fill up with cultists, stopping the selection.");
return result; return result;
} }
var minCultists = _cfg.GetCVar(WhiteCVars.CultMinPlayers);
var maxCultists = _cfg.GetCVar(WhiteCVars.CultMaxStartingPlayers);
var actualCultistCount = prefList.Count > maxCultists ? maxCultists : minCultists; var actualCultistCount = prefList.Count > maxCultists ? maxCultists : minCultists;
for (var i = 0; i < actualCultistCount; i++) 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.Runes;
using Content.Shared._White.Cult.UI; using Content.Shared._White.Cult.UI;
using Content.Shared.Mindshield.Components; using Content.Shared.Mindshield.Components;
using Content.Shared.Pulling;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.Audio.Components; using Robust.Shared.Audio.Components;
@@ -62,6 +63,7 @@ public sealed partial class CultSystem : EntitySystem
[Dependency] private readonly GunSystem _gunSystem = default!; [Dependency] private readonly GunSystem _gunSystem = default!;
[Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly FlammableSystem _flammableSystem = default!; [Dependency] private readonly FlammableSystem _flammableSystem = default!;
[Dependency] private readonly SharedPullingSystem _pulling = default!;
public override void Initialize() public override void Initialize()
@@ -664,6 +666,18 @@ public sealed partial class CultSystem : EntitySystem
foreach (var target in targets) 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); _xform.SetCoordinates(target, xFormSelected.Coordinates);
} }

View File

@@ -5,6 +5,8 @@ using Content.Shared.Actions;
using Content.Shared.Eui; using Content.Shared.Eui;
using Content.Shared.Popups; using Content.Shared.Popups;
using Content.Shared._White.Cult.UI; using Content.Shared._White.Cult.UI;
using Content.Shared.Pulling;
using Content.Shared.Pulling.Components;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Timing; using Robust.Shared.Timing;
@@ -15,6 +17,7 @@ public sealed class TeleportSpellEui : BaseEui
{ {
[Dependency] private readonly EntityManager _entityManager = default!; [Dependency] private readonly EntityManager _entityManager = default!;
private SharedTransformSystem _transformSystem; private SharedTransformSystem _transformSystem;
private SharedPullingSystem _pulling;
private PopupSystem _popupSystem; private PopupSystem _popupSystem;
@@ -32,6 +35,7 @@ public sealed class TeleportSpellEui : BaseEui
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
_transformSystem = _entityManager.System<SharedTransformSystem>(); _transformSystem = _entityManager.System<SharedTransformSystem>();
_pulling = _entityManager.System<SharedPullingSystem>();
_popupSystem = _entityManager.System<PopupSystem>(); _popupSystem = _entityManager.System<PopupSystem>();
_performer = performer; _performer = performer;
@@ -97,6 +101,19 @@ public sealed class TeleportSpellEui : BaseEui
_used = true; _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); _transformSystem.SetCoordinates(_target, runeTransform.Coordinates);
Close(); Close();
} }

View File

@@ -298,7 +298,7 @@ public sealed partial class DoorComponent : Component
public bool ClickOpen = true; public bool ClickOpen = true;
[DataField(customTypeSerializer: typeof(ConstantSerializer<DrawDepthTag>))] [DataField(customTypeSerializer: typeof(ConstantSerializer<DrawDepthTag>))]
public int OpenDrawDepth = (int) DrawDepth.DrawDepth.Doors; public int OpenDrawDepth = (int) DrawDepth.DrawDepth.SmallObjects;
[DataField(customTypeSerializer: typeof(ConstantSerializer<DrawDepthTag>))] [DataField(customTypeSerializer: typeof(ConstantSerializer<DrawDepthTag>))]
public int ClosedDrawDepth = (int) DrawDepth.DrawDepth.Doors; public int ClosedDrawDepth = (int) DrawDepth.DrawDepth.Doors;

View File

@@ -3,5 +3,5 @@
priority: 0 priority: 0
icon: icon:
sprite: Interface/Misc/health_state.rsi sprite: Interface/Misc/health_state.rsi
state: life_state state: empty_state
locationPreference: Right locationPreference: Right

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 B

View File

@@ -9,6 +9,9 @@
}, },
{ {
"name": "life_state" "name": "life_state"
},
{
"name": "empty_state"
}, },
{ {
"name": "defib_state", "name": "defib_state",