assert(lua_gettop(L) == 1);
Block *block = *(Block **)luaL_checkudata(L, 1, "Block");
- if (block->alternatives.size() != 2 ||
- block->alternatives[1]->effect_type != IDENTITY_EFFECT) {
- luaL_error(L, "disable() called on something that wasn't added with add_optional_effect()");
- }
block->currently_chosen_alternative = find_index_of(block, IDENTITY_EFFECT);
+ if (block->currently_chosen_alternative == -1) {
+ luaL_error(L, "disable() called on something that didn't have an IdentityEffect fallback (try add_optional_effect())");
+ }
assert(block->currently_chosen_alternative != -1);
return 0;
}
simple_scene.resample_effect:set_int("width", width)
simple_scene.resample_effect:set_int("height", height)
else
- simple_scene.resample_effect:choose_alternative(2) -- No scaling.
+ simple_scene.resample_effect:disable() -- No scaling.
end
set_neutral_color_from_signal(state, simple_scene.wb_effect, signal_num)
end