We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Changing tilemap in spriteOverlapsTile callback leads to uncertain result
To Reproduce
Expected behavior should result in tilemap level 2
Screenshots
Additional context https://github.com/microsoft/pxt-common-packages/blob/f40bb636d27d44e58ace6e6da06b41af055fc8a7/libs/game/physics.ts#L597
protected tilemapOverlaps(sprite: Sprite, overlappedTiles: tiles.Location[]) { const alreadyHandled: tiles.Location[] = []; // save current tile map before loop let currentTileMap = game.currentScene().tileMap for (const tile of overlappedTiles) { if (alreadyHandled.some(l => l.column === tile.column && l.row === tile.row)) { continue; } alreadyHandled.push(tile); const tileOverlapHandlers = game.currentScene().tileOverlapHandlers; if (tileOverlapHandlers) { // use saved tile map tiles, preventing tile map changed in handlers tileOverlapHandlers .filter(h => h.spriteKind == sprite.kind() && h.tileKind.equals(currentTileMap.getTileImage(tile))) .forEach(h => h.handler(sprite, tile)); } } }
The text was updated successfully, but these errors were encountered:
fix microsoft/pxt-arcade#4819
0cb099a
549d91b
Repros.
Sorry, something went wrong.
No branches or pull requests
Describe the bug
Changing tilemap in spriteOverlapsTile callback leads to uncertain result
To Reproduce
Expected behavior
should result in tilemap level 2
Screenshots
Additional context
https://github.com/microsoft/pxt-common-packages/blob/f40bb636d27d44e58ace6e6da06b41af055fc8a7/libs/game/physics.ts#L597
The text was updated successfully, but these errors were encountered: