| 2548 | }; |
| 2549 | |
| 2550 | static int items_getOuterContainerRef(lua_State *state) |
| 2551 | { |
| 2552 | auto ref = Items::getOuterContainerRef(Lua::CheckDFObject<df::item>(state, 1)); |
| 2553 | lua_newtable(state); |
| 2554 | Lua::TableInsert(state, "type", ref.type); |
| 2555 | |
| 2556 | switch (ref.type) |
| 2557 | { |
| 2558 | case specific_ref_type::UNIT: |
| 2559 | Lua::TableInsert(state, "object", ref.data.unit); |
| 2560 | break; |
| 2561 | case specific_ref_type::ITEM_GENERAL: |
| 2562 | Lua::TableInsert(state, "object", (df::item*)ref.data.object); |
| 2563 | break; |
| 2564 | case specific_ref_type::VERMIN_EVENT: |
| 2565 | Lua::TableInsert(state, "object", ref.data.vermin); |
| 2566 | break; |
| 2567 | default: |
| 2568 | Lua::TableInsert(state, "object", NULL); |
| 2569 | } |
| 2570 | return 1; |
| 2571 | } |
| 2572 | |
| 2573 | static int items_getContainedItems(lua_State *state) { |
| 2574 | vector<df::item*> pvec; |
nothing calls this directly
no test coverage detected