Skip to content

Farmer Hands Animation crashing #33

@Neosinf

Description

@Neosinf

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#>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions