4
4
namespace Celeste . Mod . MaxHelpingHand . Triggers {
5
5
[ CustomEntity ( "MaxHelpingHand/SetCustomInventoryTrigger" ) ]
6
6
public class SetCustomInventoryTrigger : Trigger {
7
- private int dashes = 1 ;
8
- private bool dreamDash = false ;
9
- private bool groundRefills = true ;
10
- private bool backpack = true ;
7
+ private readonly int dashes ;
8
+ private readonly bool dreamDash ;
9
+ private readonly bool groundRefills ;
10
+ private readonly bool backpack ;
11
11
12
12
public SetCustomInventoryTrigger ( EntityData data , Vector2 offset ) : base ( data , offset ) {
13
13
dashes = data . Int ( "dashes" ) ;
@@ -17,9 +17,12 @@ public SetCustomInventoryTrigger(EntityData data, Vector2 offset) : base(data, o
17
17
}
18
18
19
19
public override void OnEnter ( Player player ) {
20
- ( Scene as Level ) . Session . Inventory = new PlayerInventory ( dashes , dreamDash , backpack , ! groundRefills ) ;
20
+ Session session = ( Scene as Level ) . Session ;
21
+ bool hadBackpack = session . Inventory . Backpack ;
21
22
22
- if ( ! SaveData . Instance . Assists . PlayAsBadeline ) {
23
+ session . Inventory = new PlayerInventory ( dashes , dreamDash , backpack , ! groundRefills ) ;
24
+
25
+ if ( ! SaveData . Instance . Assists . PlayAsBadeline && hadBackpack != backpack ) {
23
26
player . ResetSprite ( backpack ? PlayerSpriteMode . Madeline : PlayerSpriteMode . MadelineNoBackpack ) ;
24
27
}
25
28
}
0 commit comments