Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 24 additions & 31 deletions class/class_basic_chapter.nut
Original file line number Diff line number Diff line change
Expand Up @@ -2256,7 +2256,7 @@ class basic_chapter
function is_stop_allowed_ex(tile, list, pos, wt)
{
local result = get_tile_message(3, tile)
local t_list = is_water_entry(list)
local c2d = "coord"
local t = tile_x(pos.x, pos.y, pos.z)
local buil = t.find_object(mo_building)
local is_wt = buil ? buil.get_waytype():null
Expand All @@ -2271,24 +2271,19 @@ class basic_chapter
local get_cl = square_x(pos.x, pos.y).get_climate()
local st_count = 0
for ( local j = 0; j < list.len(); j++ ) {
if ( glsw[j] == 1 )
if ( tmpsw[j] == 1 )
st_count++
}
if ( st_count < list.len() ) {
local j = 0
local c2d = "coord"
foreach(t in t_list){

local c = list[j]
if ( st_count < list.len() ) {
local c = list[st_count]
local type = typeof(c)
local st_t = type == c2d ? my_tile(c) : tile_x(c.x, c.y, c.z)
local halt = st_t.get_halt()
local tile_list = halt.get_tile_list()
local max = tile_list.len()
//local c_lim_list = {a = tile_list[0], b = tile_list[max-1]}
//gui.add_message(""+j+" :: "+tmpsw[j])
if(tmpsw[j] == 0){
//if(max == 1 && t.is_water()) return check_water_tile(result, tile_list[0], pos, j)
if(tmpsw[st_count] == 0){
//Water weather checker or wt_water
if(wt == wt_water && t.is_water()){
local area = get_tiles_near_stations(tile_list)
for( local i = 0; i < area.len(); i++ ) {
Expand All @@ -2297,40 +2292,38 @@ class basic_chapter
//gui.add_message(""+t_water.x+","+t_water.y+"")
if (pos.x == t_water.x && pos.y == t_water.y){
if ( t_water.is_water() ) {
tmpsw[j] = 1
tmpcoor.push(t)
tmpsw[st_count] = 1
tmpcoor.push(pos)
result = null
break
}
else
result = format(translate("Select station No.%d"),j+1)+" ("+c.tostring()+")."
result = format(translate("Select station No.%d"),st_count+1)+" ("+c.tostring()+")."
}
else
result = format(translate("Select station No.%d"),j+1)+" ("+c.tostring()+")."
result = format(translate("Select station No.%d"),st_count+1)+" ("+c.tostring()+")."
}
return result
}
foreach(tile in tile_list){
if (pos.x == tile.x && pos.y == tile.y && pos.z == tile.z){
if(has_way && wt == is_wt){
tmpsw[j] = 1
tmpcoor.push(st_t)
return null
}
else
return format(translate("Select station No.%d"),j+1)+" ("+c.tostring()+")."

//If they are land vehicles
foreach(tile in tile_list){
if (pos.x == tile.x && pos.y == tile.y && pos.z == tile.z){
if(has_way && wt == is_wt){
tmpsw[st_count] = 1
tmpcoor.push(pos)
return null
}
else
return format(translate("Select station No.%d"),st_count+1)+" ("+c.tostring()+")."
}
return format(translate("Select station No.%d"),j+1)+" ("+c.tostring()+")."
}
j++
if (j == t_list.len())
return result
return format(translate("Select station No.%d"),st_count+1)+" ("+c.tostring()+")."
}
}

return 0
return result
}

function get_c_key(c, i){
local res = ("coord_" + c.x + "_" + c.y + "_" + c.z +"_"+i).toalnum()
gui.add_message(""+res)
Expand Down Expand Up @@ -3777,4 +3770,4 @@ function select_cube(tile_a, tile_b, obj = "") {

return cube
}
// END OF FILE
// END OF FILE
10 changes: 6 additions & 4 deletions class/class_chapter_04.nut
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,14 @@ class tutorial.chapter_04 extends basic_chapter
d1_cnr = get_dep_cov_nr(ch4_cov_lim1.a,ch4_cov_lim1.b)
d2_cnr = get_dep_cov_nr(ch4_cov_lim2.a,ch4_cov_lim2.b)

/*local pl = 0
//Schedule list form current convoy
local pl = 0
if(this.step == 7){
local c_dep = this.my_tile(ship_depot)
local c_list = ch4_schedule_line3 //sch_list3
start_sch_tmpsw(pl, c_dep, c_list)
}*/
}

return 0
}

Expand Down Expand Up @@ -404,7 +406,7 @@ class tutorial.chapter_04 extends basic_chapter

case 7:
local c_dep = this.my_tile(ship_depot)
local line_name = line1_name
local line_name = line3_name
set_convoy_schedule(pl, c_dep, gl_wt, line_name)
if(current_cov == ch4_cov_lim3.b){
this.next_step()
Expand Down Expand Up @@ -608,7 +610,7 @@ class tutorial.chapter_04 extends basic_chapter
local c_list = ch4_schedule_line3 //sch_list3
return compare_schedule(result, pl, schedule, selc, load, time, c_list, true)
if(result == null){
local line_name = line1_name
local line_name = line3_name
update_convoy_schedule(pl, gl_wt, line_name, schedule)
}
return result
Expand Down