The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: c1710 on August 07, 2020, 10:25:41 AM

Title: r9178 Win pak128.german 2.0 - Enlarging the map causes an array out of bounds
Post by: c1710 on August 07, 2020, 10:25:41 AM
When enlarging a map in its width, the coordinate space doesn't seem to get enlarged as well.
The simu.log contains the exact same error message:
Simutrans version 121.1 Nightly from Aug  7 2020 r9178
FATAL ERROR: array2d_tpl<T>::at() - index out of bounds: (414,265) not in (0..383, 0..383)
Aborting program execution ...

For help with this error or to file a bug report please see the Simutrans forum at
http://forum.simutrans.com

(Unfortunately it doesn't state where this exception happened)
I tried enlarging the map from 768x768 to 1664x1664 (enlarging to 768x1664 works, enlarging to 896x768 doesn't work either).

pak128 seems to have the same issue.

Steps to reproduce:
Title: Re: r9178 Win pak128.german 2.0 - Enlarging the map causes an array out of bounds
Post by: c1710 on August 07, 2020, 10:28:05 AM
One thing I just noticed: When enlarging by small values (e.g. 10, I'm still experimenting), it doesn't crash.
EDIT: Sometimes it does crash, even when using small values.
Title: Re: r9178 Win pak128.german 2.0 - Enlarging the map causes an array out of bounds
Post by: ceeac on August 07, 2020, 11:20:31 AM
This patch should fix the crash.
Title: Re: r9178 Win pak128.german 2.0 - Enlarging the map causes an array out of bounds
Post by: prissi on August 07, 2020, 01:59:05 PM
Thanks for spotting this one. In in r9180