Browse Source

Error instead of crash if no spawn templates are present (with thanks to tobspr)

rdb 10 years ago
parent
commit
86eef29974
1 changed files with 6 additions and 0 deletions
  1. 6 0
      panda/src/particlesystem/particleSystem.cxx

+ 6 - 0
panda/src/particlesystem/particleSystem.cxx

@@ -247,6 +247,12 @@ spawn_child_system(BaseParticle *bp) {
     return;
   }
 
+  if (_spawn_templates.size() == 0) {
+    physics_cat.error() << "ParticleSystem::spawn_child_system: "
+                        << "no spawn templates presesnt." << endl;
+    return;
+  }
+
   NodePath physical_np = get_physical_node_path();
   NodePath parent_np = physical_np.get_parent();