From 5640436aa893741fbe004c95630d9504fa923ea8 Mon Sep 17 00:00:00 2001 From: hiker Date: Fri, 10 Mar 2017 08:38:03 +1100 Subject: [PATCH] Support cannons in reverse tracks. --- src/tracks/check_cannon.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/tracks/check_cannon.cpp b/src/tracks/check_cannon.cpp index 4b4317f7f..cad7e9820 100644 --- a/src/tracks/check_cannon.cpp +++ b/src/tracks/check_cannon.cpp @@ -37,8 +37,17 @@ CheckCannon::CheckCannon(const XMLNode &node, unsigned int index) : CheckLine(node, index) { - if( !node.get("target-p1", &m_target_left ) || - !node.get("target-p2", &m_target_right) ) + std::string p1("target-p1"); + std::string p2("target-p2"); + + if (race_manager->getReverseTrack()) + { + p1 = "p1"; + p2 = "p2"; + } + + if( !node.get(p1, &m_target_left ) || + !node.get(p2, &m_target_right) ) Log::fatal("CheckCannon", "No target line specified."); m_curve = new Ipo(*(node.getNode("curve")),