| 691 | } |
| 692 | |
| 693 | static 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 | |
| 711 | static unordered_map<string, int> get_stockpile_config(int32_t stockpile_number) { |
| 712 | unordered_map<string, int> stockpile_config; |
no test coverage detected