mirror of
https://github.com/neoStudiosLCE/neoLegacy.git
synced 2026-06-08 22:12:56 +00:00
feat(parity): climbable trapdoor if connected to ladder
This commit is contained in:
parent
e706466f42
commit
ae2dac022c
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue