Skip to content

Commit

Permalink
fix: spawn on world position
Browse files Browse the repository at this point in the history
Signed-off-by: Remuchi <RemuchiOfficial@gmail.com>
  • Loading branch information
Remuchi committed Dec 10, 2024
1 parent 19bb64a commit bca8d8f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public override void Initialize()

protected virtual void OnComponentStartup(Entity<PhaseShiftedComponent> ent, ref ComponentStartup args)
{
var pos = _transform.GetMapCoordinates(ent);
Spawn(ent.Comp.PhaseInEffect, pos);
_audio.PlayPvs(ent.Comp.PhaseInSound, Transform(ent).Coordinates);

if (TryComp<FixturesComponent>(ent, out var fixtures) && fixtures.FixtureCount >= 1)
Expand Down Expand Up @@ -73,7 +75,8 @@ private void OnThrowAttempt(Entity<PhaseShiftedComponent> ent, ref ThrowAttemptE

protected virtual void OnComponentShutdown(Entity<PhaseShiftedComponent> ent, ref ComponentShutdown args)
{
Spawn(ent.Comp.PhaseInEffect, Transform(ent).Coordinates);
Spawn(ent.Comp.PhaseOutEffect, _transform.GetMapCoordinates(ent));
_audio.PlayPvs(ent.Comp.PhaseOutSound, ent);

if (TryComp<FixturesComponent>(ent, out var fixtures) && fixtures.FixtureCount >= 1)
{
Expand All @@ -88,8 +91,5 @@ protected virtual void OnComponentShutdown(Entity<PhaseShiftedComponent> ent, re

ent.Comp.MovementSpeedBuff = 1;
_movement.RefreshMovementSpeedModifiers(ent);

Spawn(ent.Comp.PhaseOutEffect, _transform.GetMapCoordinates(ent));
_audio.PlayPvs(ent.Comp.PhaseOutSound, ent);
}
}

0 comments on commit bca8d8f

Please sign in to comment.