MCPcopy Create free account
hub / github.com/DFHack/dfhack / sort_proxy

Function sort_proxy

plugins/sort.cpp:135–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133//
134
135static bool sort_proxy(const item_or_unit &a, const item_or_unit &b) {
136 if (std::holds_alternative<df::item*>(a) || std::holds_alternative<df::item*>(b))
137 return true;
138
139 bool ret = true;
140 color_ostream &out = Core::getInstance().getConsole();
141 Lua::CallLuaModuleFunction(out, "plugins.sort", "do_sort",
142 std::make_tuple(std::get<df::unit*>(a), std::get<df::unit*>(b)),
143 1, [&](lua_State *L){
144 ret = lua_toboolean(L, 1);
145 }
146 );
147 return ret;
148}
149
150static sort_entry do_sort{
151 sort_proxy,

Callers

nothing calls this directly

Calls 2

CallLuaModuleFunctionFunction · 0.85
lua_tobooleanFunction · 0.85

Tested by

no test coverage detected