play: fix quiz_carry preview crash when pickNext nulls current mid-forEach

Made-with: Cursor
This commit is contained in:
2026-04-24 14:45:23 +00:00
parent f380e897a7
commit 6d7716811c
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -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
+1 -1
View File
@@ -692,7 +692,7 @@
</div>
<script src="/Game/socket.io/socket.io.js"></script>
<script src="js/version.js?v=0.0166"></script>
<script src="js/play.js?v=0.086"></script>
<script src="js/play.js?v=0.087"></script>
<div class="version-tag">v —</div>
</body>
</html>