+int Block_always_disable_if_disabled(lua_State *L)
+{
+ assert(lua_gettop(L) == 2);
+ Block *block = *(Block **)luaL_checkudata(L, 1, "Block");
+ Block *disabler_block = *(Block **)luaL_checkudata(L, 2, "Block");
+
+ int my_alternative = find_index_of(block, IDENTITY_EFFECT);
+ int their_alternative = find_index_of(disabler_block, IDENTITY_EFFECT);
+ if (my_alternative == -1) {
+ luaL_error(L, "always_disable_if_disabled() called on something that didn't have an IdentityEffect fallback (try add_optional_effect())");
+ }
+ if (their_alternative == -1) {
+ luaL_error(L, "always_disable_if_disabled() with an argument that didn't have an IdentityEffect fallback (try add_optional_effect())");
+ }
+
+ block->disablers.push_back(disabler_block->idx);
+
+ lua_pop(L, 2);
+ return 0;
+}
+