Use invis material to fix constant re-placement of falling blocks

This commit is contained in:
Kae 2023-10-31 08:32:20 +11:00
parent ae014e5b6f
commit 508e8f4304

View File

@ -1893,7 +1893,7 @@ bool WorldClient::readNetTile(Vec2I const& pos, NetTile const& netTile, bool upd
if (p.collision && *p.collision == netTile.collision) if (p.collision && *p.collision == netTile.collision)
p.collision.reset(); p.collision.reset();
if (p.foreground && *p.foreground == netTile.foreground) if (p.foreground && (*p.foreground == StructureMaterialId || *p.foreground == netTile.foreground))
p.foreground.reset(); p.foreground.reset();
if (p.foregroundMod && *p.foregroundMod == netTile.foregroundMod) if (p.foregroundMod && *p.foregroundMod == netTile.foregroundMod)
p.foregroundMod.reset(); p.foregroundMod.reset();
@ -2274,6 +2274,8 @@ void WorldClient::informTilePrediction(Vec2I const& pos, TileModification const&
p.foreground = placeMaterial->material; p.foreground = placeMaterial->material;
p.foregroundHueShift = placeMaterial->materialHueShift; p.foregroundHueShift = placeMaterial->materialHueShift;
} }
else
p.foreground = StructureMaterialId;
if (placeMaterial->collisionOverride != TileCollisionOverride::None) if (placeMaterial->collisionOverride != TileCollisionOverride::None)
p.collision = collisionKindFromOverride(placeMaterial->collisionOverride); p.collision = collisionKindFromOverride(placeMaterial->collisionOverride);
else else