From 20453e123e801adce933364138788305bec9f418 Mon Sep 17 00:00:00 2001 From: Bartek Gatz Date: Thu, 7 May 2026 12:36:15 +0200 Subject: [PATCH] fix(site): clamp lander position on landing to keep feet on pad (#25026) --- site/src/pages/CoderCupPage/LunarLander.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/site/src/pages/CoderCupPage/LunarLander.tsx b/site/src/pages/CoderCupPage/LunarLander.tsx index 43e1c1bf69..0367967eb2 100644 --- a/site/src/pages/CoderCupPage/LunarLander.tsx +++ b/site/src/pages/CoderCupPage/LunarLander.tsx @@ -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) {