fix: tu31 tutorial world crashes
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user