Revision: 2558
          http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2558&view=rev
Author:   ulteq
Date:     2012-05-14 12:27:02 +0000 (Mon, 14 May 2012)
Log Message:
-----------
fixes revision 2552

Revision Links:
--------------
    http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2552&view=rev

Modified Paths:
--------------
    trunk/source/main/physics/Beam.cpp

Modified: trunk/source/main/physics/Beam.cpp
===================================================================
--- trunk/source/main/physics/Beam.cpp  2012-05-14 12:25:24 UTC (rev 2557)
+++ trunk/source/main/physics/Beam.cpp  2012-05-14 12:27:02 UTC (rev 2558)
@@ -1353,12 +1353,12 @@
 {
        if (!withLocked) return totalmass; // already computed in calc_masses2
 
-       float mass = 0.0f;
+       float mass = totalmass;
        
        std::list<Beam*> linkedBeams = getAllLinkedBeams();
 
        for (std::list<Beam*>::iterator it = linkedBeams.begin(); it != 
linkedBeams.end(); ++it)
-               mass += dynamic_cast<Beam*>(*it)->totalmass;
+               mass += (*it)->totalmass;
 
        return mass;
 }
@@ -1386,11 +1386,14 @@
                                        if (it_hook->lockTruck)
                                        {
                                                ret = 
lookup_table.insert(std::pair< Beam*, bool>(it_hook->lockTruck, false));
-                                               found = found || ret.second;
+                                               if (ret.second)
+                                               {
+                                                       
result.push_back(it_hook->lockTruck);
+                                                       found = true;
+                                               }
                                        }
                                }
                                it_beam->second = true;
-                               result.push_back(it_beam->first);
                        }
                }
        }
@@ -4346,14 +4349,14 @@
        for(std::vector<tie_t>::iterator it=ties.begin(); it!=ties.end(); it++)
                if (it->beam->disabled)
                        it->beam->mSceneNode->detachAllObjects();
-
+       
        if (linked)
        {
                // apply to the locked truck
                std::list<Beam*> linkedBeams = getAllLinkedBeams();
 
                for (std::list<Beam*>::iterator it = linkedBeams.begin(); it != 
linkedBeams.end(); ++it)
-                       dynamic_cast<Beam*>(*it)->showSkeleton(meshes, newMode 
, false);
+                       (*it)->showSkeleton(meshes, newMode, false);
        }
 
        lockSkeletonchange=false;
@@ -4442,7 +4445,7 @@
                std::list<Beam*> linkedBeams = getAllLinkedBeams();
 
                for (std::list<Beam*>::iterator it = linkedBeams.begin(); it != 
linkedBeams.end(); ++it)
-                       dynamic_cast<Beam*>(*it)->showSkeleton(newMode , false);
+                       (*it)->hideSkeleton(newMode, false);
        }
 
        lockSkeletonchange=false;
@@ -4557,7 +4560,7 @@
                std::list<Beam*> linkedBeams = getAllLinkedBeams();
 
                for (std::list<Beam*>::iterator it = linkedBeams.begin(); it != 
linkedBeams.end(); ++it)
-                       dynamic_cast<Beam*>(*it)->setMeshVisibility(visible, 
false);
+                       (*it)->setMeshVisibility(visible, false);
        }
 }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Rigsofrods-devel mailing list
Rigsofrods-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel

Reply via email to