feat(parity): climbable trapdoor if connected to ladder

This commit is contained in:
neoapps-dev 2026-03-29 20:50:57 +03:00
parent e706466f42
commit ae2dac022c
2 changed files with 25 additions and 3 deletions

View file

@ -27,7 +27,7 @@ void LadderTile::updateShape(LevelSource *level, int x, int y, int z, int forceD
void LadderTile::setShape(int data)
{
int dir = data;
float r = 2 / 16.0f;
float r = 3 / 16.0f;
if (dir == 2) setShape(0, 0, 1 - r, 1, 1, 1);
if (dir == 3) setShape(0, 0, 0, 1, 1, r);

View file

@ -993,9 +993,31 @@ bool LivingEntity::onLadder()
int yt = Mth::floor(bb->y0);
int zt = Mth::floor(z);
// 4J-PB - TU9 - add climbable vines
int iTile = level->getTile(xt, yt, zt);
return (iTile== Tile::ladder_Id) || (iTile== Tile::vine_Id);
switch (iTile)
{
case Tile::ladder_Id:
case Tile::vine_Id: // 4J-PB - TU9 - add climbable vines
return true;
case Tile::trapdoor_Id: // hexagonny - add climbable (opened) trapdoors
{
if ((level->getData(xt, yt, zt) & 0x4) != 0)
{
switch (level->getTile(xt, yt + 1, zt))
{
case Tile::ladder_Id:
case Tile::vine_Id:
return false;
default:
return level->getTile(xt, yt - 1, zt) == Tile::ladder_Id;
}
}
break;
}
default:
break;
}
return false;
}
bool LivingEntity::isShootable()