diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2011-05-30 19:40:01 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2011-05-30 19:40:01 +0400 |
commit | 884b9d155705fb910657d53250a624e3ea5bd4fe (patch) | |
tree | e4a74970164fc951dee579a6f680ed56757cc84a /source/gameengine | |
parent | c141ed0aa9864cccc83e556454e778d2c1d26eda (diff) |
BGE: fix bug #26775, crash when physics constraint is defined on non-active objects. Patch provided by Sergey Sharybin, verified and applied.
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Converter/BL_BlenderDataConversion.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 1fb30925446..af768050bb6 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -2608,6 +2608,9 @@ void BL_ConvertBlenderObjects(struct Main* maggie, bConstraint *curcon; conlist = get_active_constraints2(blenderobject); + if((gameobj->GetLayer()&activeLayerBitInfo)==0) + continue; + if (conlist) { for (curcon = (bConstraint *)conlist->first; curcon; curcon=(bConstraint *)curcon->next) { if (curcon->type==CONSTRAINT_TYPE_RIGIDBODYJOINT){ @@ -2621,7 +2624,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, if (dat->tar) { KX_GameObject *gotar=getGameOb(dat->tar->id.name+2,sumolist); - if (gotar && gotar->GetPhysicsController()) + if (gotar && ((gotar->GetLayer()&activeLayerBitInfo)!=0) && gotar->GetPhysicsController()) physctr2 = (PHY_IPhysicsController*) gotar->GetPhysicsController()->GetUserData(); } |