Don't try to invalidate_ahead when path has been regularily invalidated before

master
orwell96 2021-02-10 21:41:05 +01:00
parent 0a9cb548d7
commit b65d99aa2c
1 changed files with 4 additions and 0 deletions

View File

@ -142,6 +142,10 @@ end
-- Keeps the path intact, but invalidates all path nodes from the specified index (inclusive)
-- onwards. This has the advantage that we don't need to recalculate the whole path, and we can do it synchronously.
function advtrains.path_invalidate_ahead(train, start_idx, ignore_when_passed)
if not train.path then
-- the path wasn't even initialized. Nothing to do
return
end
local idx = atfloor(start_idx)
--atdebug("Invalidate_ahead:",train.id,"start_index",start_idx,"cur_idx",train.index)