Update xyz of basketball before calling getXYZ

This commit is contained in:
Benau 2019-02-28 13:56:25 +08:00
parent 22fd9a18a3
commit a9ac35e1d5

View File

@ -395,6 +395,13 @@ bool RubberBall::updateAndDelete(int ticks)
return can_be_deleted;
}
bool can_be_deleted = Flyable::updateAndDelete(ticks);
if (can_be_deleted)
{
removePingSFX();
return true;
}
// Update normal from rewind first
const Vec3& normal =
DriveGraph::get()->getNode(getCurrentGraphNode())->getNormal();
@ -486,10 +493,7 @@ bool RubberBall::updateAndDelete(int ticks)
// Determine new distance along track
TrackSector::update(next_xyz);
bool can_be_deleted = Flyable::updateAndDelete(ticks);
if (can_be_deleted)
removePingSFX();
return can_be_deleted;
return false;
} // updateAndDelete
// ----------------------------------------------------------------------------