From 4616338fd61066eec5cd2c4a5358f0ec3d5de7bf Mon Sep 17 00:00:00 2001 From: hikerstk Date: Fri, 28 Jun 2013 23:45:48 +0000 Subject: [PATCH] Started to fix rescue problem - more code cleanup will follow later. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@13022 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/modes/linear_world.cpp | 2 +- src/modes/world.cpp | 7 ++++--- src/tracks/track_sector.cpp | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/modes/linear_world.cpp b/src/modes/linear_world.cpp index da4ed70b0..d7aa84f17 100644 --- a/src/modes/linear_world.cpp +++ b/src/modes/linear_world.cpp @@ -634,7 +634,7 @@ void LinearWorld::moveKartAfterRescue(AbstractKart* kart) m_track->getAngle(sector))); kart->getBody()->setCenterOfMassTransform(pos); - + kart->setXYZ(pos.getOrigin()); //project kart to surface of track bool kart_over_ground = m_track->findGround(kart); diff --git a/src/modes/world.cpp b/src/modes/world.cpp index e49c0a912..e28424c51 100644 --- a/src/modes/world.cpp +++ b/src/modes/world.cpp @@ -538,9 +538,10 @@ void World::resetAllKarts() //that at least one of its wheel will be on the surface of the track for ( KartList::iterator i=m_karts.begin(); i!=m_karts.end(); i++) { - ///start projection from top of kart - btVector3 up_offset(0, 0.5f * ((*i)->getKartHeight()), 0); - (*i)->getVehicle()->getRigidBody()->translate (up_offset); + Vec3 xyz = (*i)->getXYZ(); + //start projection from top of kart + Vec3 up_offset(0, 0.5f * ((*i)->getKartHeight()), 0); + (*i)->setXYZ(xyz+up_offset); bool kart_over_ground = m_track->findGround(*i); diff --git a/src/tracks/track_sector.cpp b/src/tracks/track_sector.cpp index 9c105f9c0..e7bc0ecd5 100644 --- a/src/tracks/track_sector.cpp +++ b/src/tracks/track_sector.cpp @@ -98,6 +98,8 @@ void TrackSector::update(const Vec3 &xyz) } // update // ---------------------------------------------------------------------------- +/** Sets current and last valid graph node to the rescue location. + */ void TrackSector::rescue() { if (m_last_valid_graph_node != QuadGraph::UNKNOWN_SECTOR)