Codechange: use TileIndex constructor explicitly

This commit is contained in:
Rubidium
2025-01-01 09:24:26 +01:00
committed by rubidium42
parent fd5f6caed4
commit f55ba40b13
12 changed files with 57 additions and 51 deletions

View File

@@ -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);