Minor changes to avoid undefined behaviour warnings.
Avoid creating a reference from a nullptr. Avoid trying a malloc and memcpy into a 0 length buffer. Virtual trains should never be drawn.
This commit is contained in:
@@ -236,7 +236,7 @@ protected:
|
||||
/** stores track status (available trackdirs) for the new tile into m_new_td_bits */
|
||||
inline bool QueryNewTileTrackStatus()
|
||||
{
|
||||
CPerfStart perf(*m_pPerf);
|
||||
CPerfStart perf(m_pPerf);
|
||||
if (IsRailTT() && IsPlainRailTile(m_new_tile)) {
|
||||
m_new_td_bits = (TrackdirBits)(GetTrackBits(m_new_tile) * 0x101);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user