fix(site): clamp lander position on landing to keep feet on pad (#25026)

This commit is contained in:
Bartek Gatz
2026-05-07 11:36:15 +01:00
committed by GitHub
parent 1564f2d745
commit 20453e123e
@@ -2137,6 +2137,14 @@ export const LunarLander: FC = () => {
landerAngle = 0;
thrusting = false;
landerY = pad.y - 8;
// Keep both feet (+-11px) on the pad so the
// lander cannot get stuck on the terrain slope
// at the pad edge on relaunch.
const footHalf = 11;
landerX = Math.max(
pad.x + footHalf,
Math.min(pad.x + pad.width - footHalf, landerX),
);
landedOnStation = pad.isStation;
if (pad.isStation) {