Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected tile duplication #3

Open
cavrly opened this issue Oct 22, 2023 · 0 comments
Open

Unexpected tile duplication #3

cavrly opened this issue Oct 22, 2023 · 0 comments

Comments

@cavrly
Copy link

cavrly commented Oct 22, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant