Skip to content

Commit

Permalink
The pipeline isn't cool enough to understand such complex syntax y'see
Browse files Browse the repository at this point in the history
  • Loading branch information
maddie480 committed Jun 25, 2024
1 parent 881103e commit f8f59fb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Entities/FlagTouchSwitch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,10 @@ public FlagTouchSwitch(EntityData data, Vector2 offset)
string iconAttribute = data.Attr("icon", "vanilla");

// Try to get the number of frames in the icon animation. If it works, then make an int[] for that range, and if not, stick to the default 6 frames.
int frameVal;
if (int.TryParse(data.Attr("animationLength", "6"), out frameVal))
if (int.TryParse(data.Attr("animationLength", "6"), out int frameVal))
frames = Enumerable.Range(0, frameVal).ToArray();
else
frames = [0, 1, 2, 3, 4, 5];
frames = new int[] { 0, 1, 2, 3, 4, 5 };
icon = new Sprite(GFX.Game, iconAttribute == "vanilla" ? "objects/touchswitch/icon" : $"objects/MaxHelpingHand/flagTouchSwitch/{iconAttribute}/icon");
Add(icon);
icon.Add("idle", "", 0f, default(int));
Expand Down Expand Up @@ -428,4 +427,4 @@ private bool isHidden() {
return !string.IsNullOrEmpty(hideIfFlag) && (Scene as Level).Session.GetFlag(hideIfFlag);
}
}
}
}

0 comments on commit f8f59fb

Please sign in to comment.