diff --git a/src/items/item.hpp b/src/items/item.hpp index 19152bee9..9ed3962d3 100644 --- a/src/items/item.hpp +++ b/src/items/item.hpp @@ -194,10 +194,12 @@ public: */ bool hitKart(const Vec3 &xyz, const AbstractKart *kart=NULL) const { - Vec3 diff = (xyz - m_xyz); - diff.setY(diff.getY() / 2.0f); // don't be too strict if the kart is a bit above the item - return (m_event_handler!=kart || m_deactive_time <=0) && - diff.length2() 0) + return false; + Vec3 lc = quatRotate(m_original_rotation, xyz - m_xyz); + // Don't be too strict if the kart is a bit above the item + lc.setY(lc.getY() / 2.0f); + return lc.length2() < m_distance_2; } // hitKart protected: @@ -214,7 +216,7 @@ protected: const AbstractKart *kart=NULL) const { if(m_event_handler==kart && m_deactive_time >0) return false; - + Vec3 closest = line.getClosestPoint(m_xyz.toIrrVector()); return hitKart(closest, kart); } // hitLine