diff --git a/src/graphics/stars.hpp b/src/graphics/stars.hpp index 37e2df6f4..898bf4a87 100644 --- a/src/graphics/stars.hpp +++ b/src/graphics/stars.hpp @@ -53,6 +53,8 @@ private: void showFor(float time); void reset(); void update (float delta_t); + /** Returns true if the stars are currently shown. */ + bool isEnabled() const { return m_enabled; } }; #endif diff --git a/src/items/flyable.hpp b/src/items/flyable.hpp index 7a5cb6aef..3f93398e5 100644 --- a/src/items/flyable.hpp +++ b/src/items/flyable.hpp @@ -158,6 +158,9 @@ public: void setHasHit () { m_has_hit_something = true; } void reset () { Moveable::reset(); } bool isOwnerImmunity(const Kart *kart_hit) const; + /** Returns the type of flyable. */ + PowerupManager::PowerupType + getType() const {return m_type;} virtual const char* getExplosionSound() const { return "explosion"; } /** Indicates if an explosion needs to be added if this flyable * is removed. */ diff --git a/src/karts/emergency_animation.hpp b/src/karts/emergency_animation.hpp index a22d85a06..8f72cf4a6 100644 --- a/src/karts/emergency_animation.hpp +++ b/src/karts/emergency_animation.hpp @@ -96,6 +96,8 @@ public: const float getAnimationTimer() const {return m_timer;} /** Returns true if the kart is eliminated. */ bool isEliminated () const {return m_eliminated;} + /** Returns a pointer to the stars effect. */ + const Stars *getStarEffect () const {return m_stars_effect; } void eliminate (); }; // EmergencyAnimation diff --git a/src/physics/physics.cpp b/src/physics/physics.cpp index bea0d954c..bb72a3faf 100644 --- a/src/physics/physics.cpp +++ b/src/physics/physics.cpp @@ -21,6 +21,7 @@ #include "config/user_config.hpp" #include "network/race_state.hpp" +#include "graphics/stars.hpp" #include "physics/btKart.hpp" #include "physics/btUprightConstraint.hpp" #include "physics/irr_debug_drawer.hpp" @@ -135,6 +136,11 @@ void Physics::update(float dt) } else if(p->b->is(UserPointer::UP_KART)) // projectile hit kart { + // Only explode a bowling ball if the target does not + // the stars shown + if(p->a->getPointerFlyable()->getType() + !=PowerupManager::POWERUP_BOWLING || + !p->b->getPointerKart()->getStarEffect()->isEnabled() ) p->a->getPointerFlyable()->hit(p->b->getPointerKart()); } else // projectile hits projectile