Skip to content

Commit 0fd8e51

Browse files
committed
Fix 93b: use correct ArrayList backing array ($a514) to get Stage
TeaVM ArrayList stores elements in $a514.data (not .data directly). Update dispatchTouch() to use proc.$a666.$a514.data[1] to get the Stage. https://claude.ai/code/session_01XQ6Lv2cEvrtZLgGCFgDDjT
1 parent 4b0e3af commit 0fd8e51

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

proto/output/web/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,9 @@ <h1>&#x1F409; DragonSoul Web</h1>
298298
function dispatchTouch(type, x, y) {
299299
const proc = window._dsInputProcessor;
300300
if (!proc) return;
301-
// Get the Stage: index 1 of InputMultiplexer's processor list
302-
const data = proc.$a666 && proc.$a666.data ? proc.$a666.data : null;
303-
const stage = data ? data[1] : proc; // fallback to proc itself
301+
// Get the Stage: index 1 of InputMultiplexer's $a666 ArrayList ($a514 is backing array)
302+
const arr = proc.$a666 && proc.$a666.$a514 ? proc.$a666.$a514.data : null;
303+
const stage = arr && arr.length > 1 ? arr[1] : proc;
304304
if (!stage) return;
305305
try {
306306
if (type === 'down' && stage.$touchDown1) stage.$touchDown1(x, y, 0, 0);
@@ -311,7 +311,7 @@ <h1>&#x1F409; DragonSoul Web</h1>
311311
canvas.addEventListener('mousedown', e => {
312312
e.preventDefault();
313313
const {x, y} = getGameCoords(e);
314-
console.debug('[INPUT] mousedown', x, y);
314+
console.info('[INPUT] mousedown', x, y);
315315
dispatchTouch('down', x, y);
316316
});
317317
canvas.addEventListener('mouseup', e => {

0 commit comments

Comments
 (0)