mirror of
https://github.com/misskey-dev/misskey
synced 2024-12-02 00:38:31 +09:00
✌️
This commit is contained in:
parent
f48c0a1e3f
commit
0ef2261889
@ -166,7 +166,8 @@ export default class Othello {
|
||||
* @param pos 位置
|
||||
*/
|
||||
public mapDataGet(pos: number): MapPixel {
|
||||
if (pos < 0 || pos >= this.map.length) return 'null';
|
||||
const [x, y] = this.transformPosToXy(pos);
|
||||
if (x < 0 || y < 0 || x >= this.mapWidth || y >= this.mapHeight) return 'null';
|
||||
return this.map[pos];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user