Don't tile predict falling blocks for now

causes too many mispredictions due to not simulating falling blocks locally (and it might still be an issue even if we did simulate it due to slight timing differences between client/server)
This commit is contained in:
Kae 2023-10-31 08:10:05 +11:00
parent 332fb8430b
commit 7d948f8839

View File

@ -2268,12 +2268,16 @@ void WorldClient::informTilePrediction(Vec2I const& pos, TileModification const&
p.time = now; p.time = now;
if (auto placeMaterial = modification.ptr<PlaceMaterial>()) { if (auto placeMaterial = modification.ptr<PlaceMaterial>()) {
if (placeMaterial->layer == TileLayer::Foreground) { if (placeMaterial->layer == TileLayer::Foreground) {
auto materialDatabase = Root::singleton().materialDatabase();
if (!materialDatabase->isCascadingFallingMaterial(placeMaterial->material)
&& !materialDatabase-> isFallingMaterial(placeMaterial->material)) {
p.foreground = placeMaterial->material; p.foreground = placeMaterial->material;
p.foregroundHueShift = placeMaterial->materialHueShift; p.foregroundHueShift = placeMaterial->materialHueShift;
}
if (placeMaterial->collisionOverride != TileCollisionOverride::None) if (placeMaterial->collisionOverride != TileCollisionOverride::None)
p.collision = collisionKindFromOverride(placeMaterial->collisionOverride); p.collision = collisionKindFromOverride(placeMaterial->collisionOverride);
else else
p.collision = Root::singleton().materialDatabase()->materialCollisionKind(placeMaterial->material); p.collision = materialDatabase->materialCollisionKind(placeMaterial->material);
dirtyCollision(RectI::withSize(pos, { 1, 1 })); dirtyCollision(RectI::withSize(pos, { 1, 1 }));
} else { } else {
p.background = placeMaterial->material; p.background = placeMaterial->material;