Trigger now has access to kart that triggered it

This commit is contained in:
Sachith Hasaranga Seneviratne
2014-03-24 09:05:28 +05:30
parent 954e963d1a
commit 88de3ebfb7
2 changed files with 4 additions and 0 deletions

View File

@@ -243,6 +243,9 @@ public:
/** Returns the type of this item. */
ItemType getType() const { return m_type; }
// ------------------------------------------------------------------------
/** Returns the current event handler (kart) */
const AbstractKart* getEventHandler() const { return m_event_handler;}
// ------------------------------------------------------------------------
/** Returns true if this item is currently collected. */
bool wasCollected() const { return m_collected;}
// ------------------------------------------------------------------------

View File

@@ -673,6 +673,7 @@ TrackObjectPresentationActionTrigger::TrackObjectPresentationActionTrigger(const
void TrackObjectPresentationActionTrigger::onTriggerItemApproached(Item* who)
{
const AbstractKart* kart = who->getEventHandler();
if (!m_action_active) return;
if (m_action == "garage")