Add command parameter validation to plan commands

(cherry picked from commit 957cff34dc)
This commit is contained in:
Jonathan G Rennison
2018-08-13 08:36:29 +01:00
parent 90f89770c2
commit 2f2937356b
2 changed files with 31 additions and 9 deletions

View File

@@ -125,11 +125,14 @@ struct PlanLine {
return buffer;
}
void Import(const TileIndex* data, const uint data_length)
bool Import(const TileIndex* data, const uint data_length)
{
for (uint i = data_length; i != 0; i--, data++) {
this->tiles.push_back(FROM_LE32(*data));
TileIndex t = FROM_LE32(*data);
if (t >= MapSize()) return false;
this->tiles.push_back(t);
}
return true;
}
void AddLineToCalculateCentreTile(uint64 &x, uint64 &y, uint32 &count) const