mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
(svn r22472) -Fix: When a NewGRF assigned station properties 09 and/or 0A multiple times, the previously allocated sprite layouts were not freed.
This commit is contained in:
parent
64cf720234
commit
bc6b348e7a
@ -1221,6 +1221,8 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte
|
||||
}
|
||||
|
||||
case 0x09: // Define sprite layout
|
||||
delete[] statspec->renderdata; // delete earlier loaded stuff
|
||||
|
||||
statspec->tiles = buf->ReadExtendedByte();
|
||||
statspec->renderdata = new NewGRFSpriteLayout[statspec->tiles];
|
||||
|
||||
@ -1281,6 +1283,8 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte
|
||||
continue;
|
||||
}
|
||||
|
||||
delete[] statspec->renderdata; // delete earlier loaded stuff
|
||||
|
||||
statspec->tiles = srcstatspec->tiles;
|
||||
statspec->renderdata = new NewGRFSpriteLayout[statspec->tiles];
|
||||
for (uint t = 0; t < statspec->tiles; t++) {
|
||||
|
Loading…
Reference in New Issue
Block a user