Skip to content

Unexpected tile duplication  #3

@cavrly

Description

@cavrly

Having 1 stack of any tile will suddenly place more tiles when holding the Place Platform keybind.

The tile initially placed is not accounted for when determining the heldItem's stack.

Platform.cs | class Utils | function Place

        Item heldItem = Main.LocalPlayer.HeldItem;
        . . .
        if(heldItem.stack<=config.PlatformLength) heldItem.stack--; // accounts for the tile initially being placed
        if(isWall && heldItem.stack>config.PlatformLength) heldItem.stack++; // do not know what causes an extra wall to be removed when the stack is greather than config length?
        if(heldItem.stack<=0) return; // the tile initially placed already depleted; why bother placing another one?
        . . .
        for (int n = 0; n < config.PlatformLength; n++)

Adding these lines may fix the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions