1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-19 20:49:11 +00:00

(svn r25240) [1.3] -Backport from trunk:

- Fix: [NewGRF] Make tick_counters work the same for vehicles (r25223, r25222)
- Fix: [NewGRF] IsCompatibleTrainStationTile() is not a symmetric function. Clarify the parameters and fix the cases were they were swapped (r25221)
- Fix: Consider map border as water with repsect to river/canal continuation (r25220)
- Fix: [Script] Clarify on which tiles IsDesertTile and IsSnowTile work, i.e. the ones without infrastructure or buildings, and introduce GetTerrainType for the cases where IsDesertTile/IsSnowTile do not work [FS#5537] (r25213)
- Fix: The baseset description translation script did not work with any awk other than gawk (r25218)
This commit is contained in:
rubidium
2013-05-13 19:18:10 +00:00
parent 962dda2b8b
commit a40ad243ca
13 changed files with 119 additions and 28 deletions

View File

@@ -18,6 +18,26 @@
# <ini-key>.<iso-code> = <translation>
#
# Simple insertion sort since not all AWKs have a sort implementation
function isort(A) {
n = 0
for (val in A) {
n++;
}
for (i = 2; i <= n; i++) {
j = i;
hold = A[j]
while (A[j - 1] > hold) {
j--;
A[j + 1] = A[j]
}
A[j] = hold
}
return n
}
/^!!/ {
ini_key = $2;
str_id = $3;
@@ -28,16 +48,17 @@
lang = $2;
} else if (match($0, "^" str_id " *:") > 0) {
sub("^[^:]*:", "", $0)
i++;
if (lang == "en_GB") {
texts[""] = ini_key " = "$0;
texts[i] = ini_key " = "$0;
} else {
texts[lang] = ini_key "." lang " = "$0;
texts[i] = ini_key "." lang " = "$0;
}
}
}
close(file);
count = asort(texts);
count = isort(texts);
for (i = 1; i <= count; i++) {
print texts[i]
}