update terrain.cpp

This commit is contained in:
lcw 2024-02-08 22:31:20 +08:00
parent ffe2271b6c
commit d2449abd61
2 changed files with 6 additions and 2 deletions

View File

@ -452,7 +452,7 @@ m, ,gA99,-12,s,n-10,g 1,L_10,L_n5
| `g` | 首都 | 该格子是候选首都 | | `g` | 首都 | 该格子是候选首都 |
| (无) | 要塞 | 该格子是要塞 | | (无) | 要塞 | 该格子是要塞 |
除了候选首都之外,随后对于有中立军队的格子或要塞会紧随一个数表示该格子上的初始中立单位数量,注意可能为负数或 $0$。候选首都的格式请参加下面的的“首都分配机制”小结。下面是一些描述格子的例子以及解释: 除了候选首都之外,随后对于有中立军队的格子或要塞会紧随一个 $-99999$ 至 $99999$ 中的整数表示该格子上的初始中立单位数量。候选首都的格式请参加下面的的“首都分配机制”小结。下面是一些描述格子的例子以及解释:
| 例子 | 解释 | | 例子 | 解释 |
| :--- | :--- | | :--- | :--- |

View File

@ -75,7 +75,8 @@ bool findCut(pos_t w, pos_t h, vector<vector<VertexType>> &vertex_type) {
if (!ban(vertex_type[i][j]) && !dfn[i][j]) { if (!ban(vertex_type[i][j]) && !dfn[i][j]) {
if (flag) if (flag)
return false; return false;
flag = 1, tarjan(i, j, -1, -1, 1); flag = 1;
tarjan(i, j, -1, -1, 1);
} }
} }
} }
@ -245,6 +246,9 @@ ImportedTerrain importTerrain(const ImportTerrainConfig& in) {
return x; return x;
}; };
if (t.w < 5 || t.h < 5)
error();
vector<vector<vector<Point>>> vec(27, vector<vector<Point>>(101)); vector<vector<vector<Point>>> vec(27, vector<vector<Point>>(101));
vector<vector<VertexType>> vertex_type(t.h vector<vector<VertexType>> vertex_type(t.h
, vector<VertexType>(t.w, VertexType::Ordinary)); , vector<VertexType>(t.w, VertexType::Ordinary));