mirror of
https://github.com/motajs/template.git
synced 2026-09-21 06:50:18 +08:00
fix(07-05): #06-06-1 warn code 128 for an out-of-map dynamic transfer
- transferToDynamic 越界分支由 131 改为 128,对齐两个 transferToStatic* 兄弟分支 - 取消 mapLayer.test.ts 的码 128 用例 skip
This commit is contained in:
parent
3b1b9f1d5c
commit
620382cc5f
@ -414,9 +414,8 @@ describe('MapLayer dynamic conversion', () => {
|
||||
expect([...layer.iterateDynamicTiles()]).toEqual([]);
|
||||
});
|
||||
|
||||
// 疑似缺陷 #06-06-1:transferToDynamic 越图当前复用码 131(setEventLayer 专属码),
|
||||
// 正确预期应为与 transferToStatic 一致的越界码 128,待用户确认后取消 skip
|
||||
it.skip('warns code 128 for an out-of-map transferToDynamic', () => {
|
||||
// 验证越图的 transferToDynamic 发越界码 128 且不产生图块(#06-06-1 已修复)
|
||||
it('warns code 128 for an out-of-map transferToDynamic', () => {
|
||||
const { layer } = createFixture();
|
||||
|
||||
const result = logger.catch(() => layer.transferToDynamic(9, 9));
|
||||
|
||||
@ -438,7 +438,7 @@ export class MapLayer
|
||||
keepEvent: boolean = true
|
||||
): IDynamicTile | null {
|
||||
if (!this.inMap(x, y)) {
|
||||
logger.warn(131, x.toString(), y.toString());
|
||||
logger.warn(128, x.toString(), y.toString());
|
||||
return null;
|
||||
}
|
||||
const num = this.getBlock(x, y);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user