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

Function getStockpileLinks

plugins/siege-engine.cpp:648–666  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

646}
647
648static int getStockpileLinks(lua_State *L)
649{
650 auto engine = find_engine(L, 1, false, true);
651 if (!engine || engine->stockpiles.empty())
652 return 0;
653
654 update_stockpile_links(engine);
655
656 auto &links = engine->links.take_from_pile;
657 lua_createtable(L, links.size(), 0);
658
659 for (size_t i = 0; i < links.size(); i++)
660 {
661 Lua::Push(L, links[i]);
662 lua_rawseti(L, -2, i+1);
663 }
664
665 return 1;
666}
667
668static bool isLinkedToPile(df::building_siegeenginest *bld, df::building_stockpilest *pile)
669{

Callers

nothing calls this directly

Calls 7

find_engineFunction · 0.85
update_stockpile_linksFunction · 0.85
lua_createtableFunction · 0.85
PushFunction · 0.85
lua_rawsetiFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected