This fixes an OOB array access when failing to upgrade city buildings from single-tile to multi-tile ones.
Not played around a lot with this section of code but think that maybe this code in trunk
static koord const area3x3[] = {
koord( 0, 1), // 1x2
koord( 1, 0), // 2x1
koord( 1, 1), // 2x2
koord( 2, 0), // 3x1
koord( 2, 1), // 3x2
koord( 0, 2), // 1x3
koord( 2, 2) // 3x3
};
should be
static koord const area3x3[] = {
koord( 0, 1), // 1x2
koord( 1, 0), // 2x1
koord( 1, 1), // 2x2
koord( 2, 0), // 3x1
koord( 2, 1), // 3x2
koord( 0, 2), // 1x3
koord( 1, 2), // 2x3
koord( 2, 2) // 3x3
};
This would fix the potential array out of bounds also. Although you might still want to replace 8 with lengthof to provide extra protection.
I think indeed the missing koord is needed to function properly, but lengthof is a good idea too ...
Committed in 9163 - many thanks ceeac