DirtY iCE's patch for dead scripting and bomb badguy counting
[supertux.git] / src / badguy / badguy.cpp
index fcf3b1f..0d654bb 100644 (file)
@@ -354,6 +354,18 @@ BadGuy::kill_fall()
 }
 
 void
+BadGuy::run_dead_script()
+{
+   if (countMe) Sector::current()->get_level()->stats.badguys++;
+   
+   // start dead-script
+  if(dead_script != "") {
+    std::istringstream stream(dead_script);
+    Sector::current()->run_script(stream, "dead-script");
+  }
+}
+
+void
 BadGuy::set_state(State state)
 {
   if(this->state == state)