From bb6b8d8cd60c3c1761267233ed1227d8576226db Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Mon, 29 Jan 2018 00:18:49 +0000 Subject: [PATCH] Increase verbosity of some assertion failure messages --- src/timetable_cmd.cpp | 2 +- src/train_cmd.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/timetable_cmd.cpp b/src/timetable_cmd.cpp index 5e4045b3db..f5379f3dbe 100644 --- a/src/timetable_cmd.cpp +++ b/src/timetable_cmd.cpp @@ -803,7 +803,7 @@ void UpdateVehicleTimetable(Vehicle *v, bool travelling) return; } } else { - assert(real_timetable_order == real_current_order); + assert_msg(real_timetable_order == real_current_order, "%u, %u", v->cur_real_order_index, v->cur_timetable_order_index); } if (just_started) return; diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 94cf1c6a4b..a88210baf3 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -200,7 +200,8 @@ void Train::ConsistChanged(ConsistChangeFlags allowed_changes) const RailVehicleInfo *rvi_u = RailVehInfo(u->engine_type); /* Check the this->first cache. */ - assert(u->First() == this); + assert_msg(u->First() == this, "u: %s, this: %s", + scope_dumper().VehicleInfo(u), scope_dumper().VehicleInfo(this)); /* update the 'first engine' */ u->gcache.first_engine = this == u ? INVALID_ENGINE : first_engine;