From 9cc6d63cb1f289b653c5644b371bc8b761f98eb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28=C2=B4=E3=83=BB=CF=89=E3=83=BB=EF=BD=80=29?= Date: Mon, 4 Jan 2021 13:12:41 +0900 Subject: [PATCH] CHG: Ignore schedule registration at the same point in a row --- dataobj/schedule.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dataobj/schedule.cc b/dataobj/schedule.cc index 1603e9456..0046b0155 100644 --- a/dataobj/schedule.cc +++ b/dataobj/schedule.cc @@ -121,6 +121,12 @@ bool schedule_t::insert(const grund_t* gr, uint8 minimum_loading, uint8 waiting_ return false; } + if (entries.get_count() > 0) { + if (entries[current_stop].pos == gr->get_pos()) { + return false; + } + } + if( is_stop_allowed(gr) ) { entries.insert_at(current_stop, schedule_entry_t(gr->get_pos(), minimum_loading, waiting_time_shift)); current_stop ++; @@ -144,6 +150,12 @@ bool schedule_t::append(const grund_t* gr, uint8 minimum_loading, uint8 waiting_ return false; } + if (entries.get_count() > 0) { + if (entries[entries.get_count()-1].pos == gr->get_pos()) { + return false; + } + } + if(is_stop_allowed(gr)) { entries.append(schedule_entry_t(gr->get_pos(), minimum_loading, waiting_time_shift), 4); return true;