Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix The Game 🎉 #130

Merged
merged 63 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
d4690b3
a funny script
DEATHB4DEFEAT May 8, 2023
c55e240
Merge branch 'master' of https://github.com/Park-station/Parkstation …
DEATHB4DEFEAT May 17, 2023
22eabcf
holy shit?
DEATHB4DEFEAT May 17, 2023
4e31832
rename script
DEATHB4DEFEAT May 17, 2023
1dec5cb
remove ignored prototypes on save test
DEATHB4DEFEAT May 17, 2023
16d2548
scripts
DEATHB4DEFEAT May 17, 2023
8116614
more ignored prototypes to the save test
DEATHB4DEFEAT May 17, 2023
cdf4e0d
things
DEATHB4DEFEAT May 17, 2023
84bf9fe
script
DEATHB4DEFEAT May 17, 2023
c7697cd
Merge branch 'master' of https://github.com/Park-station/Parkstation …
DEATHB4DEFEAT Jun 12, 2023
5d752d6
Merge branch 'master' of https://github.com/Park-station/Parkstation …
DEATHB4DEFEAT Sep 30, 2023
1324a83
subscribe slip stat to steptriggercomponent
DEATHB4DEFEAT Sep 30, 2023
c6a4294
remove nonexistent Guidebookbook component from ignored components
DEATHB4DEFEAT Sep 30, 2023
faa0b3c
fix misnamed armor ID usages
DEATHB4DEFEAT Sep 30, 2023
0ed4b26
cabbages are no longer profitable
DEATHB4DEFEAT Sep 30, 2023
34eba7f
disable nonexistant roundend announcement sound
DEATHB4DEFEAT Sep 30, 2023
16d6d90
fix charging pad circuit board
DEATHB4DEFEAT Sep 30, 2023
bd8419b
fix test map list
DEATHB4DEFEAT Sep 30, 2023
17905c4
don't add visiblity component to deleted entities
DEATHB4DEFEAT Sep 30, 2023
9b13cb3
it's a service worker, not valet
DEATHB4DEFEAT Sep 30, 2023
55db0a6
fix another old armor ID usage
DEATHB4DEFEAT Sep 30, 2023
5a2225f
remove another nonexistant roundend sound usage
DEATHB4DEFEAT Sep 30, 2023
60e0d26
fix charging pad using a nonexistant material
DEATHB4DEFEAT Sep 30, 2023
85454d9
fix the old armor again..
DEATHB4DEFEAT Sep 30, 2023
53f5541
check if HeightAdjusted entity has any fixtures
DEATHB4DEFEAT Sep 30, 2023
f62a6e9
give happy honk enough storage for its fill
DEATHB4DEFEAT Sep 30, 2023
6e0f6f4
try get battery component
DEATHB4DEFEAT Sep 30, 2023
5d535ee
ignoring some more prototypes for now
DEATHB4DEFEAT Sep 30, 2023
218b965
resave ParkStation
DEATHB4DEFEAT Sep 30, 2023
f7b98ce
shadokwin plush doesn't become pacified
DEATHB4DEFEAT Sep 30, 2023
be1824b
lame round end sounds
DEATHB4DEFEAT Sep 30, 2023
5e32377
fix bluespace crystal sizes
DEATHB4DEFEAT Sep 30, 2023
3516cb9
improve script
DEATHB4DEFEAT Sep 30, 2023
20feb67
science is no longer profitable
DEATHB4DEFEAT Sep 30, 2023
278f209
fix IPC Burn visuals
DEATHB4DEFEAT Sep 30, 2023
df04621
make pwoer grid check use AnnouncerSystem
DEATHB4DEFEAT Sep 30, 2023
55f2907
YAML linter script
DEATHB4DEFEAT Sep 30, 2023
8d27ada
fix prescription glasses whitelists
DEATHB4DEFEAT Sep 30, 2023
0bea12b
fix starting gear underwear
DEATHB4DEFEAT Sep 30, 2023
7345f36
remove UnisexSlime voice
DEATHB4DEFEAT Sep 30, 2023
6e7b384
fix magic speech
DEATHB4DEFEAT Sep 30, 2023
b1b0ddb
fix misnamed Chemist guidebookbook
DEATHB4DEFEAT Sep 30, 2023
2d2a265
remove "state: icon" from IPC cuffable component
DEATHB4DEFEAT Sep 30, 2023
4efbbcf
fix sleeper visuals
DEATHB4DEFEAT Sep 30, 2023
fe8b85d
fix... a lot of things with silicon chargers
DEATHB4DEFEAT Sep 30, 2023
b501c8b
remove deprecated fixture ID from glasses
DEATHB4DEFEAT Sep 30, 2023
21620a2
blank commit
DEATHB4DEFEAT Sep 30, 2023
509c0ae
huh?
DEATHB4DEFEAT Sep 30, 2023
3dd271c
ok? fix ammo rsi name
DEATHB4DEFEAT Sep 30, 2023
3db2685
why are there so many RSIs without metas
DEATHB4DEFEAT Sep 30, 2023
28a387a
fix incorrect directions in metas
DEATHB4DEFEAT Sep 30, 2023
1168507
fix science crate
DEATHB4DEFEAT Oct 1, 2023
05d2b23
fix sleepers
DEATHB4DEFEAT Oct 1, 2023
895ed79
fix science crate again ):)
DEATHB4DEFEAT Oct 1, 2023
bd7f405
remove some prototypes from savetest exceptions
DEATHB4DEFEAT Oct 1, 2023
da7f23d
fix boxer clothing
DEATHB4DEFEAT Oct 1, 2023
ca8a6bd
actually fix boxer
DEATHB4DEFEAT Oct 1, 2023
9c6797d
add back the good roundend sounds
DEATHB4DEFEAT Oct 1, 2023
89617de
Merge branch 'master' into test-fixes-test
DEATHB4DEFEAT Oct 1, 2023
5ddba43
wow bluespace is expensive
DEATHB4DEFEAT Oct 1, 2023
e28b29f
// Parkstation-RandomAnnouncers
DEATHB4DEFEAT Oct 1, 2023
cbf6ae8
Nothing
DEATHB4DEFEAT Oct 1, 2023
8bccfb3
remove the unused rsis
DEATHB4DEFEAT Oct 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions Content.IntegrationTests/Tests/PostMapInitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,9 @@ public sealed class PostMapInitTest

private static readonly string[] GameMaps =
{
"Angle",
"Arena",
"CentComm",
"Dev",
"Glacier",
"Hammurabi",
"Lighthouse",
"Northway",
"Ovni",
"Pebble",
"Shoukou",
"TheHive",
"Tortuga",
"ParkStation",
};

/// <summary>
Expand Down
48 changes: 42 additions & 6 deletions Content.IntegrationTests/Tests/PrototypeSaveTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,51 @@ public sealed class PrototypeSaveTest
// Don't add to this list unless you have a good reason
// Or it is just temporary because tests stopped working and now master has too many broken entities.

// Sorry, I'm adding to the list :)
"ClothingOuterPurpleCoat",
"MagicMedipen",
"Sleeper",
// TODO: I don't want to figure out what's wrong with these right now - Death
"SleeperPod",
"SleeperParty",
"SurveillanceCameraService",
"BenchParkMiddle",
"MobRevenant",
"SurveillanceCameraEngineering",
"ChairCarp",
"SurveillanceCameraConstructed",
"BenchParkRight",
"SiliconChargerIndustrial",
"Sleeper",
"SurveillanceCameraGeneral",
"BenchSofaCorpLeft",
"BenchSofaMiddle",
"WeaponFlamethrower",
"SurveillanceCameraCommand",
"BenchSofaCorpCorner",
"BenchPewLeft",
"BenchParkBambooMiddle",
"SleeperClockwork",
"ChairBrass",
"BenchSteelMiddle",
"BenchParkBambooLeft",
"SurveillanceCameraSecurity",
"BenchSteelLeft",
"BenchPewRight",
"BenchParkLeft",
"ClothingOuterPurpleCoat",
"BenchSteelWhiteMiddle",
"BenchSteelWhiteRight",
"BenchSofaCorner",
"SleeperParty",
"SurveillanceCameraScience",
"BenchSofaLeft",
"BenchPewMiddle",
"BenchSofaCorpRight",
"BenchSteelRight",
"BenchSteelWhiteLeft",
"BenchSofaRight",
"BenchParkBambooRight",
"SurveillanceCameraMedical",
"SurveillanceCameraSupply",
"SleeperSyndicate",
"WeaponFlamethrower",
"BenchSofaCorpMiddle",
"MobObserverTelegnostic",
};

[Test]
Expand Down
4 changes: 2 additions & 2 deletions Content.Server/Administration/UI/AdminAnnounceEui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ public sealed class AdminAnnounceEui : BaseEui
[Dependency] private readonly IAdminManager _adminManager = default!;
[Dependency] private readonly IChatManager _chatManager = default!;
[Dependency] private readonly IPrototypeManager _proto = default!;
private readonly AnnouncerSystem _announcerSystem;
private readonly AnnouncerSystem _announcerSystem; // Parkstation-RandomAnnouncers
private readonly ChatSystem _chatSystem;

public AdminAnnounceEui()
{
IoCManager.InjectDependencies(this);
_chatSystem = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<ChatSystem>();
_announcerSystem = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<AnnouncerSystem>();
_announcerSystem = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<AnnouncerSystem>(); // Parkstation-RandomAnnouncers
}

public override void Opened()
Expand Down
6 changes: 5 additions & 1 deletion Content.Server/AlertLevel/AlertLevelSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public sealed class AlertLevelSystem : EntitySystem
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly ChatSystem _chatSystem = default!;
[Dependency] private readonly StationSystem _stationSystem = default!;
[Dependency] private readonly AnnouncerSystem _announcerSystem = default!;
[Dependency] private readonly AnnouncerSystem _announcerSystem = default!; // Parkstation-RandomAnnouncers
[Dependency] private readonly IConfigurationManager _cfg = default!;

// Until stations are a prototype, this is how it's going to have to be.
Expand Down Expand Up @@ -173,6 +173,7 @@ public void SetLevel(EntityUid station, string level, bool playSound, bool annou
// var playDefault = false;
if (playSound)
{
// Parkstation-RandomAnnouncers Start
// if (detail.Sound != null)
// {
// var filter = _stationSystem.GetInOwningStation(station);
Expand All @@ -184,14 +185,17 @@ public void SetLevel(EntityUid station, string level, bool playSound, bool annou
// }

_announcerSystem.SendAnnouncementAudio($"alert{level}", _stationSystem.GetInOwningStation(station));
// Parkstation-RandomAnnouncers End
}

if (announce)
{
// Parkstation-RandomAnnouncers Start
// _chatSystem.DispatchStationAnnouncement(station, announcementFull, playDefaultSound: playDefault,
// colorOverride: detail.Color, sender: stationName);

_announcerSystem.SendAnnouncementMessage($"alert{level}", announcementFull, stationName, detail.Color, station);
// Parkstation-RandomAnnouncers End
}

RaiseLocalEvent(new AlertLevelChangedEvent(station, level));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public sealed class CommunicationsConsoleSystem : EntitySystem
[Dependency] private readonly StationSystem _stationSystem = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly AnnouncerSystem _announcerSystem = default!;
[Dependency] private readonly AnnouncerSystem _announcerSystem = default!; // Parkstation-RandomAnnouncers
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;

private const int MaxMessageLength = 256;
Expand Down Expand Up @@ -273,16 +273,20 @@ private void OnAnnounceMessage(EntityUid uid, CommunicationsConsoleComponent com
msg += "\n" + Loc.GetString("comms-console-announcement-sent-by") + " " + author;
if (comp.AnnounceGlobal)
{
// Parkstation-RandomAnnouncers Start
// _chatSystem.DispatchGlobalAnnouncement(msg, title, announcementSound: comp.AnnouncementSound, colorOverride: comp.AnnouncementColor);
_announcerSystem.SendAnnouncement("announce", Filter.Broadcast(), msg, title, comp.AnnouncementColor);
// Parkstation-RandomAnnouncers End

if (message.Session.AttachedEntity != null)
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"{ToPrettyString(message.Session.AttachedEntity.Value):player} has sent the following global announcement: {msg}");

return;
}
// Parkstation-RandomAnnouncers Start
// _chatSystem.DispatchStationAnnouncement(uid, msg, title, colorOverride: comp.AnnouncementColor);
_announcerSystem.SendAnnouncement("announce", Filter.Broadcast(), msg, title, comp.AnnouncementColor);
// Parkstation-RandomAnnouncers End

if (message.Session.AttachedEntity != null)
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"{ToPrettyString(message.Session.AttachedEntity.Value):player} has sent the following station announcement: {msg}");
Expand Down
1 change: 0 additions & 1 deletion Content.Server/Entry/IgnoredComponents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ public static class IgnoredComponents
"ItemStatus",
"Marker",
"GuidebookControlsTest",
"GuidebookBook",
"GuideHelp",
"Clickable",
"Icon",
Expand Down
4 changes: 3 additions & 1 deletion Content.Server/GameTicking/GameTicker.RoundFlow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Content.Server.GameTicking
public sealed partial class GameTicker
{
[Dependency] private readonly ITaskManager _taskManager = default!;
[Dependency] private readonly AnnouncerSystem _announcerSystem = default!;
[Dependency] private readonly AnnouncerSystem _announcerSystem = default!; // Parkstation-RandomAnnouncers

private static readonly Counter RoundNumberMetric = Metrics.CreateCounter(
"ss14_round_number",
Expand Down Expand Up @@ -563,13 +563,15 @@ private void AnnounceRound()

var proto = _robustRandom.Pick(options);

// Parkstation-RandomAnnouncers Start
// if (proto.Message != null)
// _chatSystem.DispatchGlobalAnnouncement(Loc.GetString(proto.Message), playSound: true);
//
// if (proto.Sound != null)
// SoundSystem.Play(proto.Sound.GetSound(), Filter.Broadcast());

_announcerSystem.SendAnnouncement(proto.ID, Filter.Broadcast(), Loc.GetString(proto.Message ?? "game-ticker-welcome-to-the-station"));
// Parkstation-RandomAnnouncers End
}
}

Expand Down
4 changes: 3 additions & 1 deletion Content.Server/Nyanotrasen/Fugitive/FugitiveSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public sealed class FugitiveSystem : EntitySystem
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly StunSystem _stun = default!;
[Dependency] private readonly AudioSystem _audioSystem = default!;
[Dependency] private readonly AnnouncerSystem _announcerSystem = default!;
[Dependency] private readonly AnnouncerSystem _announcerSystem = default!; // Parkstation-RandomAnnouncers
[Dependency] private readonly MindSystem _mindSystem = default!;

public override void Initialize()
Expand All @@ -63,8 +63,10 @@ public override void Update(float frameTime)
{
if (cd.AnnounceTime != null && _timing.CurTime > cd.AnnounceTime)
{
// Parkstation-RandomAnnouncers Start
// _chat.DispatchGlobalAnnouncement(Loc.GetString("station-event-fugitive-hunt-announcement"), sender: Loc.GetString("fugitive-announcement-GALPOL"), colorOverride: Color.Yellow);
_announcerSystem.SendAnnouncement("commandreport", Filter.Broadcast(), Loc.GetString("station-event-fugitive-hunt-announcement"), Loc.GetString("fugitive-announcement-GALPOL"), Color.Yellow);
// Parkstation-RandomAnnouncers End

foreach (var console in EntityQuery<CommunicationsConsoleComponent>())
{
Expand Down
48 changes: 27 additions & 21 deletions Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem
[Dependency] private readonly ShuttleSystem _shuttle = default!;
[Dependency] private readonly StationSystem _station = default!;
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
[Dependency] private readonly AnnouncerSystem _announcer = default!;
[Dependency] private readonly AnnouncerSystem _announcer = default!; // Parkstation-RandomAnnouncers

private ISawmill _sawmill = default!;

Expand Down Expand Up @@ -188,15 +188,17 @@ public void CallEmergencyShuttle(EntityUid stationUid, StationEmergencyShuttleCo
if (targetGrid == null)
{
_logger.Add(LogType.EmergencyShuttle, LogImpact.High, $"Emergency shuttle {ToPrettyString(stationUid)} unable to dock with station {ToPrettyString(stationUid)}");
// Parkstation-RandomAnnouncers Start
// _chatSystem.DispatchStationAnnouncement(stationUid, Loc.GetString("emergency-shuttle-good-luck"), playDefaultSound: false);
// // TODO: Need filter extensions or something don't blame me.
// _audio.PlayGlobal("/Audio/Misc/notice1.ogg", Filter.Broadcast(), true);
// // TODO: Need filter extensions or something don't blame me.
// _audio.PlayGlobal("/Audio/Misc/notice1.ogg", Filter.Broadcast(), true);
DEATHB4DEFEAT marked this conversation as resolved.
Show resolved Hide resolved

_announcer.SendAnnouncement("shuttledock", Filter.Broadcast(),
Loc.GetString("emergency-shuttle-good-luck"),
Loc.GetString("comms-console-announcement-title-centcom"));
return;
}
_announcer.SendAnnouncement("shuttledock", Filter.Broadcast(),
Loc.GetString("emergency-shuttle-good-luck"),
Loc.GetString("comms-console-announcement-title-centcom"));
// Parkstation-RandomAnnouncers End
return;
}

var xformQuery = GetEntityQuery<TransformComponent>();

Expand All @@ -205,24 +207,28 @@ public void CallEmergencyShuttle(EntityUid stationUid, StationEmergencyShuttleCo
if (TryComp<TransformComponent>(targetGrid.Value, out var targetXform))
{
var angle = _dock.GetAngle(stationShuttle.EmergencyShuttle.Value, xform, targetGrid.Value, targetXform, xformQuery);
// Parkstation-RandomAnnouncers Start
// _chatSystem.DispatchStationAnnouncement(stationUid, Loc.GetString("emergency-shuttle-docked", ("time", $"{_consoleAccumulator:0}"), ("direction", angle.GetDir())), playDefaultSound: false);
_announcer.SendAnnouncementMessage("shuttledock",
Loc.GetString("emergency-shuttle-docked",("time", $"{_consoleAccumulator:0}"), ("direction", angle.GetDir())),
Loc.GetString("comms-console-announcement-title-centcom"));
}
_announcer.SendAnnouncementMessage("shuttledock",
Loc.GetString("emergency-shuttle-docked",("time", $"{_consoleAccumulator:0}"), ("direction", angle.GetDir())),
Loc.GetString("comms-console-announcement-title-centcom"));
// Parkstation-RandomAnnouncers End
}

_logger.Add(LogType.EmergencyShuttle, LogImpact.High, $"Emergency shuttle {ToPrettyString(stationUid)} docked with stations");
// TODO: Need filter extensions or something don't blame me.
// Parkstation-RandomAnnouncers Start
// _audio.PlayGlobal("/Audio/Announcements/shuttle_dock.ogg", Filter.Broadcast(), true);
_announcer.SendAnnouncementAudio("shuttledock", Filter.Broadcast());
}
else
{
if (TryComp<TransformComponent>(targetGrid.Value, out var targetXform))
{
var angle = _dock.GetAngle(stationShuttle.EmergencyShuttle.Value, xform, targetGrid.Value, targetXform, xformQuery);
_chatSystem.DispatchStationAnnouncement(stationUid, Loc.GetString("emergency-shuttle-nearby", ("direction", angle.GetDir())), playDefaultSound: false);
}
_announcer.SendAnnouncementAudio("shuttledock", Filter.Broadcast());
// Parkstation-RandomAnnouncers End
}
else
{
if (TryComp<TransformComponent>(targetGrid.Value, out var targetXform))
{
var angle = _dock.GetAngle(stationShuttle.EmergencyShuttle.Value, xform, targetGrid.Value, targetXform, xformQuery);
_chatSystem.DispatchStationAnnouncement(stationUid, Loc.GetString("emergency-shuttle-nearby", ("direction", angle.GetDir())), playDefaultSound: false);
}

_logger.Add(LogType.EmergencyShuttle, LogImpact.High, $"Emergency shuttle {ToPrettyString(stationUid)} unable to find a valid docking port for {ToPrettyString(stationUid)}");
// TODO: Need filter extensions or something don't blame me.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Content.Shared.GameTicking;
using Content.Shared.SimpleStation14.CCVar;
using Content.Shared.Slippery;
using Content.Shared.StepTrigger.Components;
using Robust.Shared.Configuration;
using Robust.Shared.Timing;

Expand All @@ -28,14 +29,14 @@ public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<SlipperyComponent, SlipEvent>(OnSlip);
SubscribeLocalEvent<StepTriggerComponent, SlipEvent>(OnSlip);

SubscribeLocalEvent<RoundEndTextAppendEvent>(OnRoundEnd);
SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundRestart);
}


private void OnSlip(EntityUid uid, SlipperyComponent slipComp, ref SlipEvent args)
private void OnSlip(EntityUid uid, StepTriggerComponent component, ref SlipEvent args)
{
string? username = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ public override void Initialize()

private void OnBatteryInit(EntityUid uid, RandomBatteryChargeComponent component, ComponentInit args)
{
var batteryComp = Comp<BatteryComponent>(uid);
DebugTools.AssertNotNull(batteryComp);

if (batteryComp == null)
if (!TryComp<BatteryComponent>(uid, out var batteryComp))
return;

var (minMaxMod, maxMaxMod) = component.BatteryMaxMinMax;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ private void DarkSwap(EntityUid uid, ShadowkinDarkSwapPowerComponent component,
args.Performer,
!hasComp,
!hasComp,
!hasComp,
true,
args.StaminaCostOn,
args.PowerCostOn,
Expand All @@ -94,6 +95,7 @@ public void SetDarkened(
EntityUid performer,
bool addComp,
bool invisible,
bool pacify,
bool darken,
float staminaCostOn,
float powerCostOn,
Expand All @@ -115,6 +117,7 @@ public void SetDarkened(
{
var comp = _entity.EnsureComponent<ShadowkinDarkSwappedComponent>(performer);
comp.Invisible = invisible;
comp.Pacify = pacify;
comp.Darken = darken;

RaiseNetworkEvent(new ShadowkinDarkSwappedEvent(performer, true));
Expand Down Expand Up @@ -142,7 +145,8 @@ public void SetDarkened(

private void OnInvisStartup(EntityUid uid, ShadowkinDarkSwappedComponent component, ComponentStartup args)
{
EnsureComp<PacifiedComponent>(uid);
if (component.Pacify)
EnsureComp<PacifiedComponent>(uid);

if (component.Invisible)
SetCanSeeInvisibility(uid, true);
Expand Down Expand Up @@ -172,7 +176,8 @@ private void OnInvisShutdown(EntityUid uid, ShadowkinDarkSwappedComponent compon

public void SetCanSeeInvisibility(EntityUid uid, bool set)
{
var visibility = _entity.EnsureComponent<VisibilityComponent>(uid);
if (!TryComp<VisibilityComponent>(uid, out var visibility))
return;

if (set)
{
Expand All @@ -185,7 +190,7 @@ public void SetCanSeeInvisibility(EntityUid uid, bool set)
_visibility.RemoveLayer(uid, visibility, (int) VisibilityFlags.Normal, false);
_visibility.RefreshVisibility(uid);

if (!_entity.TryGetComponent<GhostComponent>(uid, out var _))
if (!_entity.TryGetComponent<GhostComponent>(uid, out _))
_stealth.SetVisibility(uid, 0.8f, _entity.EnsureComponent<StealthComponent>(uid));
}
else
Expand All @@ -199,7 +204,7 @@ public void SetCanSeeInvisibility(EntityUid uid, bool set)
_visibility.AddLayer(uid, visibility, (int) VisibilityFlags.Normal, false);
_visibility.RefreshVisibility(uid);

if (!_entity.TryGetComponent<GhostComponent>(uid, out var _))
if (!_entity.TryGetComponent<GhostComponent>(uid, out _))
_entity.RemoveComponent<StealthComponent>(uid);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ private void Startup(EntityUid uid, HeightAdjustedComponent component, Component
// Set density of the entity using SetDensity
if (_entityManager.TryGetComponent<FixturesComponent>(uid, out var fixtures))
{
if (fixtures.FixtureCount == 0)
return;

var density = fixtures.Fixtures.Values.First().Density;
component.OriginalDensity = density;
var newDensity = density * (component.Width + component.Height) / 2;
Expand Down
Loading
Loading