From 089f6d108ec781886241b94016c568e4bc4bfa5a Mon Sep 17 00:00:00 2001 From: Alayan Date: Fri, 12 Oct 2018 18:18:23 +0200 Subject: [PATCH] Add 5s to the FTL countdown when the leader is hit by a flyable --- src/modes/follow_the_leader.cpp | 14 ++++++++++++++ src/modes/follow_the_leader.hpp | 1 + 2 files changed, 15 insertions(+) diff --git a/src/modes/follow_the_leader.cpp b/src/modes/follow_the_leader.cpp index 49ac44b9c..c938e6ff7 100644 --- a/src/modes/follow_the_leader.cpp +++ b/src/modes/follow_the_leader.cpp @@ -221,6 +221,20 @@ bool FollowTheLeaderRace::isRaceOver() } } // isRaceOver +//----------------------------------------------------------------------------- +/** If the leader kart is hit, increase the delay to the next elimination */ +bool FollowTheLeaderRace::kartHit(int kart_id, int hitter) +{ + if (kart_id == 0) + { + int countdown = getTimeTicks(); + countdown += stk_config->time2Ticks(5.0f); + setTicks(countdown); + } + + return false; +} + //----------------------------------------------------------------------------- /** Called at the end of a race. Updates highscores, pauses the game, and * informs the unlock manager about the finished race. This function must diff --git a/src/modes/follow_the_leader.hpp b/src/modes/follow_the_leader.hpp index a2f5b97e6..b116a0153 100644 --- a/src/modes/follow_the_leader.hpp +++ b/src/modes/follow_the_leader.hpp @@ -54,6 +54,7 @@ public: virtual void init() OVERRIDE; virtual void terminateRace() OVERRIDE; virtual bool isRaceOver() OVERRIDE; + virtual bool kartHit(int kart_id, int hitter = -1) OVERRIDE; // ------------------------------------------------------------------------ /** Returns if this type of race has laps. */ virtual bool raceHasLaps() OVERRIDE { return false; }