Also increase the FTL countdown when the leader is rescued
This commit is contained in:
parent
a4142c13c1
commit
4734e50a68
@ -23,10 +23,12 @@
|
||||
#include "items/attachment.hpp"
|
||||
#include "karts/abstract_kart.hpp"
|
||||
#include "karts/kart_properties.hpp"
|
||||
#include "modes/follow_the_leader.hpp"
|
||||
#include "modes/three_strikes_battle.hpp"
|
||||
#include "network/network_config.hpp"
|
||||
#include "physics/physics.hpp"
|
||||
#include "physics/triangle_mesh.hpp"
|
||||
#include "race/race_manager.hpp"
|
||||
#include "tracks/drive_graph.hpp"
|
||||
#include "tracks/quad.hpp"
|
||||
#include "tracks/track.hpp"
|
||||
@ -45,7 +47,7 @@ RescueAnimation::RescueAnimation(AbstractKart *kart, bool is_auto_rescue,
|
||||
: AbstractKartAnimation(kart, "RescueAnimation")
|
||||
{
|
||||
btTransform prev_trans = kart->getTrans();
|
||||
// Get the required final physicial transform for network, then reset back
|
||||
// Get the required final physical transform for network, then reset back
|
||||
// to the original transform
|
||||
World::getWorld()->moveKartAfterRescue(kart);
|
||||
|
||||
@ -89,6 +91,15 @@ RescueAnimation::RescueAnimation(AbstractKart *kart, bool is_auto_rescue,
|
||||
}
|
||||
}
|
||||
|
||||
// Allow FTL mode to apply special action when the leader is rescued
|
||||
if (race_manager->isFollowMode())
|
||||
{
|
||||
FollowTheLeaderRace *ftl_world =
|
||||
dynamic_cast<FollowTheLeaderRace*>(World::getWorld());
|
||||
if(ftl_world->isLeader(kart->getWorldKartId()))
|
||||
ftl_world->leaderRescued();
|
||||
}
|
||||
|
||||
// Clear powerups when rescue in CTF
|
||||
if (!from_state)
|
||||
{
|
||||
|
@ -63,6 +63,8 @@ public:
|
||||
|
||||
bool isLeader(int kart_id) { return (kart_id == 0); }
|
||||
void leaderHit();
|
||||
// For now, use a similar countdown change as with leaderHit
|
||||
void leaderRescued() { leaderHit(); }
|
||||
}; // FollowTheLeader
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user