Skip to content

Commit 5491907

Browse files
committed
空中判定を修正
1 parent add7479 commit 5491907

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/ability.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,9 @@ export function init(cx: Context): () => void {
4444
export function focusCoord(cx: Context, player: Player) {
4545
const { blockSize, marginY } = get(cx.config);
4646
const middleX = Math.floor(player.x / blockSize);
47-
const outerBottomX = Math.floor((player.y - marginY) / blockSize);
4847

49-
// 空中にブロックを置けないように
50-
const middleBlock = cx.grid.getBlock(cx, middleX, outerBottomX);
48+
// 自分が空中にいる状態でブロックを置けないように
49+
const middleBlock = cx.grid.getBlock(cx, middleX, getCoords(cx).y + 1);
5150
const playerIsTryingToPlaceInAir = middleBlock === null;
5251
if (playerIsTryingToPlaceInAir) {
5352
return null;

0 commit comments

Comments
 (0)