| 110 | } |
| 111 | |
| 112 | bool stockpile_method(const char *method, building_stockpilest *sp) { |
| 113 | // Combines the select_order and toggle_trigger method calls, |
| 114 | // because they share the same signature. |
| 115 | auto L = Lua::Core::State; |
| 116 | color_ostream_proxy out(Core::getInstance().getConsole()); |
| 117 | |
| 118 | Lua::StackUnwinder top(L); |
| 119 | |
| 120 | if (!lua_checkstack(L, 2)) |
| 121 | return false; |
| 122 | |
| 123 | if (!Lua::PushModulePublic(out, L, "plugins.stockflow", method)) |
| 124 | return false; |
| 125 | |
| 126 | Lua::Push(L, sp); |
| 127 | |
| 128 | if (!Lua::SafeCall(out, L, 1, 0)) |
| 129 | return false; |
| 130 | |
| 131 | // Invalidate the string cache. |
| 132 | stockpile_id = -1; |
| 133 | |
| 134 | return true; |
| 135 | } |
| 136 | |
| 137 | bool collect_settings(building_stockpilest *sp) { |
| 138 | // Find strings representing the job to order, and the trigger condition. |
no test coverage detected