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

swimming in liquid is not affected by collision box size #15646

Open
SnoutBug opened this issue Jan 6, 2025 · 2 comments
Open

swimming in liquid is not affected by collision box size #15646

SnoutBug opened this issue Jan 6, 2025 · 2 comments
Labels
@ Client / Controls / Input Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible

Comments

@SnoutBug
Copy link

SnoutBug commented Jan 6, 2025

Luanti version

Luanti 5.10.0 Flatpak

Operating system and version

Flatpak

CPU model

No response

GPU model

No response

Active renderer

No response

Summary

When creating a nodebox as a liquid, the shape of the nodebox does not affect the swimmable area

Steps to reproduce

  • Create a nodebox half the height of a node
  • Make it a liquid
  • notice the player swimming at the height of a full node
@SnoutBug SnoutBug added the Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible label Jan 6, 2025
@sfan5
Copy link
Collaborator

sfan5 commented Jan 6, 2025

For testing convenience please provide the code of the node you have defined.

@SnoutBug
Copy link
Author

SnoutBug commented Jan 6, 2025

Sure, here is a small demo:

local source_liquid_def = core.registered_nodes["default:water_source"]

local node_name = "water_bug:water_low"

local half_def = {
    description = "water_bug:water_low",
    tiles = source_liquid_def.tiles,
    use_texture_alpha = source_liquid_def.use_texture_alpha,
    paramtype = source_liquid_def.paramtype,
    walkable = source_liquid_def.walkable,
    pointable = source_liquid_def.pointable,
    diggable = source_liquid_def.diggable,
    buildable_to = source_liquid_def.buildable_to,
    is_ground_content = source_liquid_def.is_ground_content,
    drawtype = "nodebox",
    drop = source_liquid_def.drop,
    drowning = source_liquid_def.drowning,
    liquidtype = "source",
    liquid_alternative_flowing = node_name,
    liquid_alternative_source = node_name,
    liquid_range = 0,
    liquid_viscosity = source_liquid_def.liquid_viscosity,
    liquid_renewable = false,
    waving = source_liquid_def.waving,
    color = source_liquid_def.color,
    node_box = {
        type = "fixed",
        fixed = {
            { -0.5, -0.5, -0.5, 0.5, -0.375, 0.5 },
        },
    },
    collision_box = {
        type = "fixed",
        fixed = { -0.5, -0.5, -0.5, 0.5, -0.375, 0.5 },
    },
    post_effect_color = source_liquid_def.post_effect_color,
    groups = source_liquid_def.groups,
    sounds = source_liquid_def.sounds,
}

core.register_node(node_name, half_def)

This creates a node that is 1/8 the height of a normal node based on water_source.

If you place both water_bug:water_low and default:water_source next to another, you will not notice a difference when swimming through them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@ Client / Controls / Input Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible
Projects
None yet
Development

No branches or pull requests

2 participants