Files
Delta-v/Content.Server/Weather/WeatherSystem.cs
4186c8caa2 Weather entities (#41427)
* weather status effect entities

* proto port + fixes

* Update weather.yml

* fix visuals

* Update SharedWeatherSystem.cs

* Update SharedWeatherSystem.cs

* Update WeatherSystem.cs

* Thanks Slarti, thats a much better

* Update WeatherSystem.cs

* Update StencilOverlay.Weather.cs

* Update Content.Client/Overlays/StencilOverlay.Weather.cs

Co-authored-by: Pok <113675512+Pok27@users.noreply.github.com>

* Update Content.Shared/StatusEffectNew/Components/StatusEffectComponent.cs

Co-authored-by: Pok <113675512+Pok27@users.noreply.github.com>

* Update Content.Client/Overlays/StencilOverlay.Weather.cs

Co-authored-by: Pok <113675512+Pok27@users.noreply.github.com>

* Revise weather command help descriptions

Updated weather command help texts for clarity.

* Merge branch 'master' into ed-14-11-2025-weather-entities

* Tayrtahn review apply

* fixes and cleanup

---------

Co-authored-by: Pok <113675512+Pok27@users.noreply.github.com>
Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2026-06-29 12:44:02 +02:00

31 lines
1.1 KiB
C#

using Content.Shared.Weather;
using Robust.Server.GameStates;
namespace Content.Server.Weather;
public sealed class WeatherSystem : SharedWeatherSystem
{
//I dont really like to PVS override weather entities, but map status effect containers dont PVS-ing out of the box
[Dependency] private readonly PvsOverrideSystem _pvs = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<WeatherStatusEffectComponent, ComponentInit>(OnCompInit);
SubscribeLocalEvent<WeatherStatusEffectComponent, ComponentShutdown>(OnCompShutdown);
}
private void OnCompInit(Entity<WeatherStatusEffectComponent> ent, ref ComponentInit args)
{
// The map entitiy itself is networked by PVS if the player is on that map but not anything inside a container,
// So we need to add an overridce to make sure the client sees it.
_pvs.AddGlobalOverride(ent);
}
private void OnCompShutdown(Entity<WeatherStatusEffectComponent> ent, ref ComponentShutdown args)
{
_pvs.RemoveGlobalOverride(ent);
}
}