9 | + ret = EnsureNoShipOnDiagDir(tile_cur, ReverseDiagDir(direction));
| 9 | + TileIndex tc = tile_cur;
|
---|
| | 10 | + DiagDirection dir_rotate = ReverseDiagDir(direction);
|
---|
| | 11 | + ret = EnsureNoShipOnDiagDir(tc, dir_rotate);
|
---|
| | 12 | + if (ret.Failed()) return ret;
|
---|
| | 13 | +
|
---|
| | 14 | + tc = dir_rotate == DIAGDIR_NE ? tc + TileDiffXY(-1, -1) : dir_rotate == DIAGDIR_NW ? tc + TileDiffXY(1, -1) : dir_rotate == DIAGDIR_SW ? tc + TileDiffXY(1, 1) : tc + TileDiffXY(-1, 1);
|
---|
| | 15 | + dir_rotate = ChangeDiagDir(dir_rotate, DIAGDIRDIFF_90RIGHT);
|
---|
| | 16 | + ret = EnsureNoShipOnDiagDir(tc, dir_rotate);
|
---|
| | 17 | + if (ret.Failed()) return ret;
|
---|
| | 18 | +
|
---|
| | 19 | + tc = dir_rotate == DIAGDIR_NE ? tc + TileDiffXY(-2, 0) : dir_rotate == DIAGDIR_NW ? tc + TileDiffXY(0, -2) : dir_rotate == DIAGDIR_SW ? tc + TileDiffXY(2, 0) : tc + TileDiffXY(0, 2);
|
---|
| | 20 | + dir_rotate = ReverseDiagDir(dir_rotate);
|
---|
| | 21 | + ret = EnsureNoShipOnDiagDir(tc, dir_rotate);
|
---|