1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-16 17:02:37 +01:00

(svn r22178) [1.1] -Backport from trunk:

- Fix: [NewGRF] Memory leak if an industry NewGRF had more than one prop A or 15, or a station NewGRF had more than one prop 09 (r22175, r22165)
- Fix: [NewGRF] Disable a station NewGRF when it contains an unterminated spritelayout in action0 prop 08 instead of crashing (r22164)
- Fix: Building a station part adjacent to both an existing station and a rail waypoint failed [FS#4541] (r22163)
This commit is contained in:
rubidium
2011-03-03 21:47:13 +00:00
parent 40f3583c54
commit 1d2baecb5e
6 changed files with 64 additions and 30 deletions

View File

@@ -14,6 +14,8 @@
#include "viewport_func.h"
#include "landscape.h"
#include "spritecache.h"
#include "core/alloc_func.hpp"
#include "core/mem_func.hpp"
/**
@@ -108,3 +110,17 @@ void DrawCommonTileSeqInGUI(int x, int y, const DrawTileSprites *dts, int32 orig
}
}
}
/** Create a copy of an existing DrawTileSeqStruct array. */
const DrawTileSeqStruct *CopyDrawTileSeqStruct(const DrawTileSeqStruct *dtss)
{
const DrawTileSeqStruct *element;
size_t count = 1; // 1 for the terminator
foreach_draw_tile_seq(element, dtss) count++;
DrawTileSeqStruct *copy = MallocT<DrawTileSeqStruct>(count);
MemCpyT(copy, dtss, count);
return copy;
}