mirror of
https://github.com/corvax-team/ss14-wl.git
synced 2026-09-15 14:52:26 +02:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
29 lines
1.0 KiB
C#
29 lines
1.0 KiB
C#
using Content.Shared.Weather;
|
|
using Robust.Server.GameStates;
|
|
|
|
namespace Content.Server.Weather;
|
|
|
|
public sealed partial 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 PvsOverrideSystem _pvs = default!;
|
|
|
|
public override void 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);
|
|
}
|
|
}
|