-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
Hello
My mod crashes when attempting this single animation, so I have added a compat to avoid it, but it might be worth looking into.
I assume that I'm using the animateOnce method correctly. All the parameters sent to it are expected/normal.
Full code below.
Regards
Neosinf
<C#>if (Mod.instance.Helper.ModRegistry.IsLoaded("PeacefulEnd.FashionSense"))
{
return;
}
player.Halt();
FarmerSprite.AnimationFrame carryAnimation;
int frameIndex;
bool frameFlip = false;
switch (direction)
{
case 0: // Up
frameIndex = 12;
break;
case 1: // Right
frameIndex = 6;
break;
case 2: // Down
frameIndex = 0;
break;
default: // Left
frameIndex = 6;
frameFlip = true; // same as right but flipped
break;
}
carryAnimation = new(frameIndex, timeFrame, true, frameFlip);
player.FarmerSprite.animateOnce(new FarmerSprite.AnimationFrame[1] { carryAnimation });</C#>
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels