Allowing scorer identification if he shot the ball with a projectile.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14250 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
@@ -515,4 +515,9 @@ HitEffect* Flyable::getHitEffect() const
|
||||
return new Explosion(getXYZ(), "explosion", "explosion_cake.xml");
|
||||
} // getHitEffect
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
unsigned int Flyable::getOwnerId()
|
||||
{
|
||||
return m_owner->getWorldKartId();
|
||||
}
|
||||
/* EOF */
|
||||
|
||||
@@ -208,6 +208,8 @@ public:
|
||||
* call, or if the inheriting object will update TerrainInfo itself
|
||||
* (or perhaps not at all if it is not needed). */
|
||||
void setDoTerrainInfo(bool d) { m_do_terrain_info = d; }
|
||||
// ------------------------------------------------------------------------
|
||||
unsigned int getOwnerId();
|
||||
}; // Flyable
|
||||
|
||||
#endif
|
||||
|
||||
@@ -235,6 +235,13 @@ void Physics::update(float dt)
|
||||
// -------------------------------
|
||||
p->getUserPointer(0)->getPointerFlyable()
|
||||
->hit(NULL, p->getUserPointer(1)->getPointerPhysicalObject());
|
||||
PhysicalObject* obj = p->getUserPointer(1)->getPointerPhysicalObject();
|
||||
if(obj->isSoccerBall())
|
||||
{
|
||||
int kartId = p->getUserPointer(0)->getPointerFlyable()->getOwnerId();
|
||||
SoccerWorld* soccerWorld = (SoccerWorld*)World::getWorld();
|
||||
soccerWorld->setLastKartTohitBall(kartId);
|
||||
}
|
||||
|
||||
}
|
||||
else if(p->getUserPointer(1)->is(UserPointer::UP_KART))
|
||||
|
||||
Reference in New Issue
Block a user