02-05-2020, Saturday-12:30:52
(Dieser Beitrag wurde zuletzt bearbeitet: 02-05-2020, Saturday-12:36:59 von Andarix.)
Bekomme da den Fehler das cost_road_stop nicht existiert.
commbined_connection
Sollte mit dem Code von GitHub reproduzierbar sein.
commbined_connection
Zitat: /**
* Does steps land-tile -> halt -> harbour -> water
* Last route tile is cnode, check if station can be placed.
* Check for harbour tiles, put corresponding nodes to open list.
*/
function process_node_to_land_halt(cnode, halt)
{
// process all tiles of this halt
foreach(tile in halt.get_tile_list()) {
if (!tile.is_water() && ship_connector_t.get_harbour_halt(tile)!=null) {
local harbour_node = ab_node(tile, cnode, cnode.cost, cnode.dist, 0x0f, 0x0f)
local d = 0
if (tile.get_slope()) {
// get direction from slope
d = dir.backward(slope.to_dir(tile.get_slope()))
}
else {
// flat dock, check all four neighbour tiles for water + harbour
d = 1
}
do {
local to = coord3d(tile.x, tile.y, tile.z) + dir.to_coord(d)
if (world.is_coord_valid(to)) {
local move = cost_road_stop
local dist = estimate_distance(to)
local cost = cnode.cost + move
local weight = cost + dist
local node = ab_node(to, harbour_node, cost, dist, d, 0x0f)
add_to_open(node, weight)
}
d = d*2
} while (tile.get_slope()==0 && d<16)
}
}
}
Sollte mit dem Code von GitHub reproduzierbar sein.
Script-KI für Simutrans r10894+ / Simutrans Nightly Builds