fix: prevent TNT minecarts from exploding if TNT host option is disabled (#921)

This commit is contained in:
Alezito2008
2026-03-08 05:02:23 -03:00
committed by GitHub
parent 110e86ca2a
commit d461012efb

View File

@@ -80,9 +80,12 @@ void MinecartTNT::explode(double speedSqr)
if (!level->isClientSide)
{
double speed = sqrt(speedSqr);
if (speed > 5) speed = 5;
level->explode(shared_from_this(), x, y, z, (float) (4 + random->nextDouble() * 1.5f * speed), true);
remove();
if (speed > 5.0) speed = 5.0;
if (app.GetGameHostOption(eGameHostOption_TNT))
{
level->explode(shared_from_this(), x, y, z, (float) (4 + random->nextDouble() * 1.5f * speed), true);
remove();
}
}
}