mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-22 01:47:39 -07:00
✌️
This commit is contained in:
parent
ce57bb1b9b
commit
e27acbb990
1 changed files with 2 additions and 1 deletions
|
@ -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 a new issue