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

Function find_stockpiles

plugins/logistics.cpp:693–709  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

691}
692
693static void find_stockpiles(lua_State *L, int idx,
694 vector<df::building_stockpilest*> &sps) {
695 if (lua_isnumber(L, idx)) {
696 if (auto sp = find_stockpile(lua_tointeger(L, idx)))
697 sps.emplace_back(sp);
698 return;
699 }
700
701 const char * pname = lua_tostring(L, idx);
702 if (!pname || !*pname)
703 return;
704 string name(pname);
705 for (auto sp : world->buildings.other.STOCKPILE) {
706 if (name == sp->name)
707 sps.emplace_back(sp);
708 }
709}
710
711static unordered_map<string, int> get_stockpile_config(int32_t stockpile_number) {
712 unordered_map<string, int> stockpile_config;

Callers 2

Calls 2

lua_isnumberFunction · 0.85
find_stockpileFunction · 0.85

Tested by

no test coverage detected