Loading
#openttdcoop - Paste
Archives
Trending
Docs
Login
Paste #pwtccbjkr
Wrap
Raw
Revise
function
Road
::
_GetDirectionEfficient
(
from
,
to
,
is_bridge
,
map_size_x
=
Road
.
_map_size_x
)
{
if
(
!
is_bridge
&&
AITile
.
GetSlope
(
to
)
==
AITile
.
SLOPE_FLAT
)
return
0xFF;
local
diff
=
from
-
to;
switch
(
diff
)
{
case
1
:
return
1
;
case
-
1
:
return
2
;
case
map_size_x
:
return
4
;
case
-
map_size_x
:
return
8
;
default
:
assert
(
false
)
;
}
}
Comments