Skip to content

Commit 7312933

Browse files
committed
Remove DynamicData usage in DreamHoldable
1 parent f136494 commit 7312933

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

src/Components/DreamHoldable.cs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
using MonoMod.Utils;
2-
using System.Reflection;
3-
41
namespace Celeste.Mod.CommunalHelper.Components;
52

63
[TrackedAs(typeof(Holdable))]
74
internal class DreamHoldable : Holdable
85
{
9-
private static readonly MethodInfo m_Player_Pickup = typeof(Player).GetMethod("Pickup", BindingFlags.NonPublic | BindingFlags.Instance);
10-
116
public readonly DreamDashCollider DreamDashCollider;
127
public bool AllowDreamDash
138
{
@@ -27,14 +22,8 @@ public DreamHoldable(Collider dreamDashCollider, float cannotHoldDelay = 0.1f, A
2722

2823
private void OnDreamDashEnter(Player player)
2924
{
30-
DynamicData data = DynamicData.For(player);
31-
32-
BloomPoint starFlyBloom = data.Get<BloomPoint>("starFlyBloom");
33-
3425
// Prevents a crash caused by entering the feather fly state while dream dashing through a dream holdable.
35-
starFlyBloom ??= new(new Vector2(0f, -6f), 0f, 16f) { Visible = false };
36-
37-
data.Set("starFlyBloom", starFlyBloom);
26+
player.starFlyBloom ??= new(new Vector2(0f, -6f), 0f, 16f) { Visible = false };
3827
}
3928

4029
public void OnDreamDashExit(Player player)
@@ -43,10 +32,10 @@ public void OnDreamDashExit(Player player)
4332
if (Input.GrabCheck && player.DashDir.Y <= 0 && player.Holding == null)
4433
{
4534
// force-allow pickup
46-
player.GetData().Set("minHoldTimer", 0f);
35+
player.minHoldTimer = 0f;
4736
cannotHoldTimer = 0f;
4837

49-
if ((bool) m_Player_Pickup.Invoke(player, new object[] { this }))
38+
if (player.Pickup(this))
5039
{
5140
player.StateMachine.State = Player.StPickup;
5241
}

src/Entities/DreamBlocks/DreamJellyfish.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using Celeste.Mod.CommunalHelper.Imports;
33
using Mono.Cecil.Cil;
44
using MonoMod.Cil;
5-
using MonoMod.Utils;
65
using System.Reflection;
76

87
namespace Celeste.Mod.CommunalHelper.Entities;

0 commit comments

Comments
 (0)