Check for out-of-bound terrains when building roads

Thanks to @fosnola for noticing this.
This commit is contained in:
2023-01-21 20:42:07 -05:00
parent 80b6a6decf
commit 17ad90ece1
2 changed files with 9 additions and 2 deletions

View File

@@ -442,6 +442,7 @@ bool outd_is_special(location to_check) {
}
bool impassable(ter_num_t terrain_to_check) {
if(terrain_to_check >= univ.scenario.ter_types.size()) return true;
if(univ.scenario.ter_types[terrain_to_check].blocksMove())
return true;
else return false;