The following commit has been merged in the master branch:
commit fccb8c814f11fcbd251fd9ef4dbbf5dd3b6606ae
Author: Anton Gladky <[email protected]>
Date:   Thu Apr 21 22:54:59 2011 +0200

    Fix crash, when force applied to non existing body

diff --git a/debian/patches/fix_force_applying_to_non_existing_body.patch 
b/debian/patches/fix_force_applying_to_non_existing_body.patch
new file mode 100644
index 0000000..749c537
--- /dev/null
+++ b/debian/patches/fix_force_applying_to_non_existing_body.patch
@@ -0,0 +1,27 @@
+Description: Fix crash, when force applied to non existing body 
+Author: Anton Gladky <[email protected]>
+Applied-Upstream: http://bazaar.launchpad.net/~yade-dev/yade/0.60/revision/2570
+Last-Update: 2011-04-21
+
+--- a/pkg/common/ForceEngine.cpp
++++ b/pkg/common/ForceEngine.cpp
+@@ -14,7 +14,7 @@
+ 
+ void ForceEngine::action(){
+       FOREACH(Body::id_t id, ids){
+-              assert(scene->bodies->exists(id));
++              if (!(scene->bodies->exists(id))) continue;
+               scene->forces.addForce(id,force);
+       }
+ }
+--- a/pkg/common/PressTestEngine.cpp
++++ b/pkg/common/PressTestEngine.cpp
+@@ -7,7 +7,7 @@
+       if (curentDirection != stop) {
+               if (curentDirection==forward) {                                 
                                                 ///<Forward direction of the 
press
+                       FOREACH(Body::id_t id, ids){
+-                              assert(scene->bodies->exists(id));
++                              if (!(scene->bodies->exists(id))) continue;
+                               currentVerticalForce = 
scene->forces.getForce(id)[2];   ///<Define current vertical force
+                               minimalForce = maxVerticalForce*0.1;            
                                                        ///<Define minimal edge 
of the force (10% from Maximal)
+                               minimalPredictedForce = predictedForce*0.1;     
                                        ///<Define minimal edge of the 
Predicted force (10% from Predicted)
diff --git a/debian/patches/series b/debian/patches/series
index cf5671b..b8a4621 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 fix_memory_wrong_accces_after_body_erase.patch
 fix_spelling_errors.patch
+fix_force_applying_to_non_existing_body.patch

-- 
Yet Another Dynamic Engine. Platform for discrete element modeling.

_______________________________________________
Mailing list: https://launchpad.net/~yade-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to