Codechange: make explicit when a TileIndex is cast to its basetype (#11190)
This prevents people accidentially assigning a TileIndex to a Date or any other type they shouldn't.
This commit is contained in:
@@ -21,14 +21,14 @@ void ScriptTileList::AddRectangle(TileIndex t1, TileIndex t2)
|
||||
if (!::IsValidTile(t2)) return;
|
||||
|
||||
TileArea ta(t1, t2);
|
||||
for (TileIndex t : ta) this->AddItem(t);
|
||||
for (TileIndex t : ta) this->AddItem(static_cast<uint32_t>(t));
|
||||
}
|
||||
|
||||
void ScriptTileList::AddTile(TileIndex tile)
|
||||
{
|
||||
if (!::IsValidTile(tile)) return;
|
||||
|
||||
this->AddItem(tile);
|
||||
this->AddItem(static_cast<uint32_t>(tile));
|
||||
}
|
||||
|
||||
void ScriptTileList::RemoveRectangle(TileIndex t1, TileIndex t2)
|
||||
@@ -37,14 +37,14 @@ void ScriptTileList::RemoveRectangle(TileIndex t1, TileIndex t2)
|
||||
if (!::IsValidTile(t2)) return;
|
||||
|
||||
TileArea ta(t1, t2);
|
||||
for (TileIndex t : ta) this->RemoveItem(t);
|
||||
for (TileIndex t : ta) this->RemoveItem(static_cast<uint32_t>(t));
|
||||
}
|
||||
|
||||
void ScriptTileList::RemoveTile(TileIndex tile)
|
||||
{
|
||||
if (!::IsValidTile(tile)) return;
|
||||
|
||||
this->RemoveItem(tile);
|
||||
this->RemoveItem(static_cast<uint32_t>(tile));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user