For now avoid the crash in #446 by the ball just immediately being
removed when it is fired, which is unsatisfactory. I leave #446 open to find a better solution. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9926 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
fa4bbcb3a2
commit
8dfa57202b
@ -63,10 +63,18 @@ RubberBall::RubberBall(Kart *kart, Track* track)
|
||||
setAdjustUpVelocity(false);
|
||||
m_max_lifespan = 9999;
|
||||
m_target = NULL;
|
||||
m_ping_sfx = sfx_manager->createSoundSource("ball_bounce");
|
||||
// Just init the previoux coordinates with some value that's not getXYZ()
|
||||
m_previous_xyz = m_owner->getXYZ();
|
||||
|
||||
computeTarget();
|
||||
if(!m_target)
|
||||
{
|
||||
// This happens if the kart firing the rubber ball is the leader
|
||||
// of all karts left in the race.
|
||||
hit(NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
// initialises the current graph node
|
||||
TrackSector::update(getXYZ(), kart, track);
|
||||
@ -78,7 +86,6 @@ RubberBall::RubberBall(Kart *kart, Track* track)
|
||||
m_timer = 0.0f;
|
||||
m_interval = m_st_interval;
|
||||
m_current_max_height = m_max_height;
|
||||
m_ping_sfx = sfx_manager->createSoundSource("ball_bounce");
|
||||
} // RubberBall
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user