From 6d7716811c16a03f0a76835fe677cc009a86e6a3 Mon Sep 17 00:00:00 2001 From: giteaadmin Date: Fri, 24 Apr 2026 14:45:23 +0000 Subject: [PATCH] play: fix quiz_carry preview crash when pickNext nulls current mid-forEach Made-with: Cursor --- www/html/Game/public/js/play.js | 2 ++ www/html/Game/public/play.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/www/html/Game/public/js/play.js b/www/html/Game/public/js/play.js index fba8ea9..f91f460 100644 --- a/www/html/Game/public/js/play.js +++ b/www/html/Game/public/js/play.js @@ -2142,6 +2142,8 @@ if (!o.botPath || o.botPath.length === 0) { tryQuizCarryInteractionForPlayer(id, o.x, o.y, { silent: true }); } + /* ตอบถูกแล้ว pickNext เริ่มนับถอยหลัง → quizCarryCurrent เป็น null ในรอบ forEach เดียวกัน */ + if (!quizCarryCurrent) return; const tier = o.botTier || 'avg'; const pCorrect = tier === 'sharp' ? 0.9 : tier === 'weak' ? 0.35 : 0.65; const rawWant = Math.random() < pCorrect ? quizCarryCurrent.correctIndex diff --git a/www/html/Game/public/play.html b/www/html/Game/public/play.html index 3458907..21ae70b 100644 --- a/www/html/Game/public/play.html +++ b/www/html/Game/public/play.html @@ -692,7 +692,7 @@ - +
v —