parent
dac65af983
commit
e2ae763dba
|
@ -123,7 +123,6 @@ end
|
|||
-- This function should be 'atprint', 'atlog', 'atwarn' or 'atdebug', because it needs to use print_concat_table
|
||||
function advtrains.path_print(train, printf)
|
||||
if not train.path then
|
||||
printf("path_print: tid =",train.train_id," index =",train.index," end_index =",train.end_index," vel =",train.velocity)
|
||||
printf("path_print: Path is invalidated/inexistant.")
|
||||
return
|
||||
end
|
||||
|
|
|
@ -612,24 +612,11 @@ advtrains.te_register_on_update(function(id, train)
|
|||
old_index = old_index + 1
|
||||
local pos = advtrains.round_vector_floor_y(advtrains.path_get(train,old_index))
|
||||
tnc_call_enter_callback(pos, id, train, old_index)
|
||||
|
||||
if not train.path then
|
||||
atwarn(id,"@register_on_update missing path")
|
||||
atwarn(advtrains.dbg_last_pathclear)
|
||||
return
|
||||
end
|
||||
end
|
||||
while old_end_index < new_end_index do
|
||||
local pos = advtrains.round_vector_floor_y(advtrains.path_get(train,old_end_index))
|
||||
tnc_call_leave_callback(pos, id, train, old_end_index)
|
||||
old_end_index = old_end_index + 1
|
||||
|
||||
if not train.path then
|
||||
atwarn(id,"@register_on_update missing path")
|
||||
atwarn(advtrains.dbg_last_pathclear)
|
||||
return
|
||||
end
|
||||
|
||||
end
|
||||
train.tnc.old_index = new_index
|
||||
train.tnc.old_end_index = new_end_index
|
||||
|
|
Loading…
Reference in New Issue