sprite = sprite_manager->create(sprite_name);
} else if(token == "count") {
iter.value()->get(hit_counter);
- } else if(token == "script") {
+ } else if(token == "script") { // use when bonusblock is to contain ONLY a script
iter.value()->get(script);
} else if(token == "contents") {
std::string contentstring;
}
case CONTENT_SCRIPT:
- {
- if(script != "") {
- std::istringstream stream(script);
- Sector::current()->run_script(stream, "powerup-script");
- }
- break;
- }
+ { break; } // because scripts always run, this prevents default contents from being assumed
+
case CONTENT_LIGHT:
{
if(sprite->get_action() == "on")
}
}
+ if(script != "") { // scripts always run if defined
+ std::istringstream stream(script);
+ Sector::current()->run_script(stream, "powerup-script");
+ }
+
start_bounce(player);
if(hit_counter <= 0 || contents == CONTENT_LIGHT){ //use 0 to allow infinite hits
}else if(hit_counter == 1){