Skip to content

Commit

Permalink
fugg :-DDD
Browse files Browse the repository at this point in the history
  • Loading branch information
RedFoxIV committed Feb 16, 2025
1 parent 7951fe0 commit c4eb20a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Content.Client/_White/Light/RotatePointLightSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ public sealed class RotatePointLightSystem : SharedRotatePointLightSystem
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<RotatePointLightComponent, ComponentStartup>(CompInit);
SubscribeLocalEvent<RotatePointLightComponent, ComponentStartup>(CompStartup);
SubscribeLocalEvent<RotatePointLightComponent, AfterAutoHandleStateEvent>(AfterAutoState);
}

private void CompInit(EntityUid uid, RotatePointLightComponent comp, ComponentStartup args)
private void CompStartup(EntityUid uid, RotatePointLightComponent comp, ComponentStartup args)
{
UpdateRotation(uid, comp);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,22 @@ public abstract class SharedRotatePointLightSystem : EntitySystem
{
public override void Initialize()
{
SubscribeLocalEvent<RotatePointLightComponent, ComponentInit>(CompInit);
SubscribeLocalEvent<RotatePointLightComponent, EntGotInsertedIntoContainerMessage>(OnInserted);
SubscribeLocalEvent<RotatePointLightComponent, EntGotRemovedFromContainerMessage>(OnRemoved);
}

//public override void FrameUpdate(float frameTime)
//{
// var query = EntityQueryEnumerator<RotatePointLightComponent>();
//
// while(query.MoveNext(out var uid, out var comp))
// {
// if (!comp.Enabled ||
// !TryComp<TransformComponent>(uid, out var xform))
// continue;
//
// xform.LocalRotation += comp.Angle;
// }
//}
private void CompInit(EntityUid uid, RotatePointLightComponent comp, ComponentInit args)
{
if (!TryComp<TransformComponent>(uid, out var xform))
return;

comp.Enabled = xform.GridUid == xform.ParentUid ||
xform.MapUid == xform.ParentUid;
Dirty(uid, comp);
UpdateRotation(uid, comp);
}


private void OnInserted(EntityUid uid, RotatePointLightComponent comp, EntGotInsertedIntoContainerMessage args)
{
Expand Down

0 comments on commit c4eb20a

Please sign in to comment.