fix: tu31 tutorial world crashes

This commit is contained in:
Fireblade
2026-05-02 21:30:34 -04:00
parent 02f1be3bb7
commit 229d22ab7b
10 changed files with 58 additions and 24 deletions
+9 -4
View File
@@ -179,7 +179,8 @@ void LivingEntity::checkFallDamage(double ya, bool onGround)
}
}
if (t > 0)
Tile *tile = Tile::tiles[t];
if (t > 0 && tile != nullptr) // tu31 tutorial world fix
{
Tile::tiles[t]->fallOn(level, xt, yt, zt, shared_from_this(), fallDistance);
}
@@ -1560,10 +1561,12 @@ void LivingEntity::travel(float xa, float ya)
if (onGround)
{
frictionTile = level->getTile(Mth::floor(x), Mth::floor(bb->y0) - 1, Mth::floor(z));
Tile *tile = Tile::tiles[frictionTile];
friction = 0.6f * 0.91f;
if (frictionTile > 0)
{
friction = Tile::tiles[frictionTile]->friction * 0.91f;
if (tile == nullptr) tile = Tile::tiles[1];
friction = tile->friction * 0.91f;
}
}
@@ -1586,8 +1589,10 @@ void LivingEntity::travel(float xa, float ya)
{
friction = 0.6f * 0.91f;
if (frictionTile > 0)
{
friction = Tile::tiles[frictionTile]->friction * 0.91f;
{
Tile *tile = Tile::tiles[frictionTile];
if (tile == nullptr) tile = Tile::tiles[1];
friction = tile->friction * 0.91f;
}
}
if (onLadder())