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

Function update_stockpile_links

plugins/siege-engine.cpp:631–646  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

629}
630
631static void update_stockpile_links(EngineInfo *engine)
632{
633 engine->links.take_from_pile.clear();
634
635 for (auto it = engine->stockpiles.begin(); it != engine->stockpiles.end(); )
636 {
637 int id = *it; ++it;
638 auto pile = df::building::find(id);
639
640 if (!pile || pile->getType() != building_type::Stockpile)
641 forgetStockpileLink(engine, id);
642 else
643 // The vector is sorted, but we are iterating through a sorted set
644 engine->links.take_from_pile.push_back(pile);
645 }
646}
647
648static int getStockpileLinks(lua_State *L)
649{

Callers 2

getStockpileLinksFunction · 0.85

Calls 6

forgetStockpileLinkFunction · 0.85
getTypeMethod · 0.80
findFunction · 0.50
clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected