Skip to content
Snippets Groups Projects
  • Auke Kok's avatar
    9de43cdf
    Doors: Allow falling nodes to fall onto doors. · 9de43cdf
    Auke Kok authored
    We were cleverly attempting to use an airlike node as the
    top half of the doors, but as airlike nodes are not walkable,
    falling nodes would not stop falling and thus remain an entity
    stuck on top of a door.
    
    After inspecting the builtin/game/falling.lua code, I considered
    the remaining options: (a) revert doors such that the top part is
    actually the door, (b) play with nodedef fields and see if other
    flags may work, or (c) modify the hidden door part to another
    drawtype that properly prevents this issue.
    
    (a) seemed way over the top for now, although it would solve the
    issue, it would cause a rewrite of most of the code including the
    old-door-conversion.
    
    (b) turned up nothing.
    
    (c) turned out to be relatively simple.
    
    So, here's the implementation where I turn the hidden door top
    into a tiny, non-targetable but walkable nodebox that is entirely
    inside the door hinge. It's entirely transparent, so you still
    can't see it, can't hit it, nor can you place anything in it or
    make liquids flow through it. The top part is placed in the right
    position on placement and not touched further.
    
    Falling nodes will properly stop on top of these doors. I've
    adjusted the door conversion code to properly account for the
    issue as well, so the only thing remaining is people who have
    been running a git branch - those can upgrade by re-placing the
    door.
    9de43cdf
    History
    Doors: Allow falling nodes to fall onto doors.
    Auke Kok authored
    We were cleverly attempting to use an airlike node as the
    top half of the doors, but as airlike nodes are not walkable,
    falling nodes would not stop falling and thus remain an entity
    stuck on top of a door.
    
    After inspecting the builtin/game/falling.lua code, I considered
    the remaining options: (a) revert doors such that the top part is
    actually the door, (b) play with nodedef fields and see if other
    flags may work, or (c) modify the hidden door part to another
    drawtype that properly prevents this issue.
    
    (a) seemed way over the top for now, although it would solve the
    issue, it would cause a rewrite of most of the code including the
    old-door-conversion.
    
    (b) turned up nothing.
    
    (c) turned out to be relatively simple.
    
    So, here's the implementation where I turn the hidden door top
    into a tiny, non-targetable but walkable nodebox that is entirely
    inside the door hinge. It's entirely transparent, so you still
    can't see it, can't hit it, nor can you place anything in it or
    make liquids flow through it. The top part is placed in the right
    position on placement and not touched further.
    
    Falling nodes will properly stop on top of these doors. I've
    adjusted the door conversion code to properly account for the
    issue as well, so the only thing remaining is people who have
    been running a git branch - those can upgrade by re-placing the
    door.