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
+3 -1
View File
@@ -111,7 +111,9 @@ int Camera::getBlockAt(Level *level, shared_ptr<LivingEntity> player, float alph
Vec3 *p = Camera::getCameraPos(player, alpha);
TilePos tp = TilePos(p);
int t = level->getTile(tp.x, tp.y, tp.z);
if (t != 0 && Tile::tiles[t]->material->isLiquid())
Tile *tile = Tile::tiles[t];
if (tile == nullptr) return 0; // tu31 tutorial world fix
if (t != 0 && tile->material->isLiquid())
{
float hh = LiquidTile::getHeight(level->getData(tp.x, tp.y, tp.z)) - 1 / 9.0f;
float h = tp.y + 1 - hh;