Merge branch 'master' into jgrpp

# Conflicts:
#	src/lang/german.txt
#	src/lang/korean.txt
#	src/lang/spanish_MX.txt
#	src/lang/traditional_chinese.txt
#	src/script/api/script_airport.cpp
#	src/script/api/script_rail.cpp
This commit is contained in:
Jonathan G Rennison
2022-06-06 01:03:00 +01:00
15 changed files with 948 additions and 635 deletions

View File

@@ -27,6 +27,7 @@
#include "newgrf_sound.h"
#include "newgrf_station.h"
#include "industrytype.h"
#include "industry_map.h"
#include "newgrf_canal.h"
#include "newgrf_townname.h"
#include "newgrf_industries.h"
@@ -3538,15 +3539,22 @@ static ChangeInfoResult IgnoreIndustryProperty(int prop, ByteReader *buf)
static bool ValidateIndustryLayout(const IndustryTileLayout &layout)
{
const size_t size = layout.size();
if (size == 0) return false;
size_t valid_regular_tiles = 0;
for (size_t i = 0; i < size - 1; i++) {
for (size_t j = i + 1; j < size; j++) {
if (layout[i].ti.x == layout[j].ti.x &&
layout[i].ti.y == layout[j].ti.y) {
return false;
}
if (layout[i].gfx != GFX_WATERTILE_SPECIALCHECK) {
++valid_regular_tiles;
}
}
}
return true;
return valid_regular_tiles > 0;
}
/**
@@ -3697,7 +3705,7 @@ static ChangeInfoResult IndustriesChangeInfo(uint indid, int numinfo, int prop,
/* Declared as been valid, can be used */
it.gfx = tempid;
}
} else if (it.gfx == 0xFF) {
} else if (it.gfx == GFX_WATERTILE_SPECIALCHECK) {
it.ti.x = (int8)GB(it.ti.x, 0, 8);
it.ti.y = (int8)GB(it.ti.y, 0, 8);