mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-22 11:44:17 +01:00
Codechange: use TileIndex constructor explicitly
This commit is contained in:
@@ -99,8 +99,8 @@ static void _DoCommandReturnBuildBridge1(class ScriptInstance *instance)
|
||||
EnforceDeityOrCompanyModeValid(false);
|
||||
|
||||
/* Build the piece of road on the 'start' side of the bridge */
|
||||
TileIndex end = ScriptObject::GetCallbackVariable(0);
|
||||
TileIndex start = ScriptObject::GetCallbackVariable(1);
|
||||
TileIndex end(ScriptObject::GetCallbackVariable(0));
|
||||
TileIndex start(ScriptObject::GetCallbackVariable(1));
|
||||
|
||||
DiagDirection dir_1 = ::DiagdirBetweenTiles(end, start);
|
||||
DiagDirection dir_2 = ::ReverseDiagDir(dir_1);
|
||||
@@ -113,8 +113,8 @@ static void _DoCommandReturnBuildBridge1(class ScriptInstance *instance)
|
||||
EnforceDeityOrCompanyModeValid(false);
|
||||
|
||||
/* Build the piece of road on the 'end' side of the bridge */
|
||||
TileIndex end = ScriptObject::GetCallbackVariable(0);
|
||||
TileIndex start = ScriptObject::GetCallbackVariable(1);
|
||||
TileIndex end(ScriptObject::GetCallbackVariable(0));
|
||||
TileIndex start(ScriptObject::GetCallbackVariable(1));
|
||||
|
||||
DiagDirection dir_1 = ::DiagdirBetweenTiles(end, start);
|
||||
DiagDirection dir_2 = ::ReverseDiagDir(dir_1);
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
StoryPage *story_page = nullptr;
|
||||
if (type == GT_STORY_PAGE && ScriptStoryPage::IsValidStoryPage((ScriptStoryPage::StoryPageID)destination)) story_page = ::StoryPage::Get((ScriptStoryPage::StoryPageID)destination);
|
||||
return (type == GT_NONE && destination == 0) ||
|
||||
(type == GT_TILE && ScriptMap::IsValidTile(destination)) ||
|
||||
(type == GT_TILE && ScriptMap::IsValidTile(::TileIndex(destination))) ||
|
||||
(type == GT_INDUSTRY && ScriptIndustry::IsValidIndustry(destination)) ||
|
||||
(type == GT_TOWN && ScriptTown::IsValidTown(destination)) ||
|
||||
(type == GT_COMPANY && ScriptCompany::ResolveCompanyID((ScriptCompany::CompanyID)destination) != ScriptCompany::COMPANY_INVALID) ||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
EnforcePrecondition(false, type == NT_ECONOMY || type == NT_SUBSIDIES || type == NT_GENERAL);
|
||||
EnforcePrecondition(false, company == ScriptCompany::COMPANY_INVALID || ScriptCompany::ResolveCompanyID(company) != ScriptCompany::COMPANY_INVALID);
|
||||
EnforcePrecondition(false, (ref_type == NR_NONE) ||
|
||||
(ref_type == NR_TILE && ScriptMap::IsValidTile(reference)) ||
|
||||
(ref_type == NR_TILE && ScriptMap::IsValidTile(::TileIndex(reference))) ||
|
||||
(ref_type == NR_STATION && ScriptStation::IsValidStation(reference)) ||
|
||||
(ref_type == NR_INDUSTRY && ScriptIndustry::IsValidIndustry(reference)) ||
|
||||
(ref_type == NR_TOWN && ScriptTown::IsValidTown(reference)));
|
||||
|
||||
@@ -102,8 +102,8 @@ static void _DoCommandReturnBuildTunnel1(class ScriptInstance *instance)
|
||||
EnforceDeityOrCompanyModeValid(false);
|
||||
|
||||
/* Build the piece of road on the 'start' side of the tunnel */
|
||||
TileIndex end = ScriptObject::GetCallbackVariable(0);
|
||||
TileIndex start = ScriptTunnel::GetOtherTunnelEnd(end);
|
||||
TileIndex end(ScriptObject::GetCallbackVariable(0));
|
||||
TileIndex start{ScriptTunnel::GetOtherTunnelEnd(end)};
|
||||
|
||||
DiagDirection dir_1 = ::DiagdirBetweenTiles(end, start);
|
||||
DiagDirection dir_2 = ::ReverseDiagDir(dir_1);
|
||||
@@ -116,8 +116,8 @@ static void _DoCommandReturnBuildTunnel1(class ScriptInstance *instance)
|
||||
EnforceDeityOrCompanyModeValid(false);
|
||||
|
||||
/* Build the piece of road on the 'end' side of the tunnel */
|
||||
TileIndex end = ScriptObject::GetCallbackVariable(0);
|
||||
TileIndex start = ScriptTunnel::GetOtherTunnelEnd(end);
|
||||
TileIndex end(ScriptObject::GetCallbackVariable(0));
|
||||
TileIndex start{ScriptTunnel::GetOtherTunnelEnd(end)};
|
||||
|
||||
DiagDirection dir_1 = ::DiagdirBetweenTiles(end, start);
|
||||
DiagDirection dir_2 = ::ReverseDiagDir(dir_1);
|
||||
|
||||
Reference in New Issue
Block a user