mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r1365) -Fix: very, very nasty buffer overflow bug introduced with replace vehicles. You CANNOT access the i[255] of an array that only has 255 elements! I will kick the next person that does that so hard...goddammit (I only noticed it because it screwed up my console in the debug build and took me at least an hour to fix)
This commit is contained in:
parent
5a9478cdba
commit
3a48ab4c54
4
misc.c
4
misc.c
@ -185,9 +185,9 @@ void InitializeGame()
|
||||
{
|
||||
// Initialize the autoreplace array. Needs to be cleared between each game
|
||||
int i;
|
||||
for (i = 0; i < 256; i++) {
|
||||
for (i = 0; i < lengthof(_autoreplace_array); i++)
|
||||
_autoreplace_array[i] = i;
|
||||
}
|
||||
|
||||
AddTypeToEngines(); // make sure all engines have a type
|
||||
|
||||
SetObjectToPlace(1, 0, 0, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user