| 5651 | } |
| 5652 | |
| 5653 | bool lua_handin(luabind::adl::object handin_table) |
| 5654 | { |
| 5655 | std::map<std::string, uint32> handin_map; |
| 5656 | |
| 5657 | for (luabind::iterator i(handin_table), end; i != end; i++) { |
| 5658 | std::string key; |
| 5659 | if (luabind::type(i.key()) == LUA_TSTRING) { |
| 5660 | key = luabind::object_cast<std::string>(i.key()); |
| 5661 | } |
| 5662 | else if (luabind::type(i.key()) == LUA_TNUMBER) { |
| 5663 | key = fmt::format("{}", luabind::object_cast<int>(i.key())); |
| 5664 | } |
| 5665 | else { |
| 5666 | LogError("Handin key type [{}] not supported", luabind::type(i.key())); |
| 5667 | } |
| 5668 | |
| 5669 | if (!key.empty()) { |
| 5670 | handin_map[key] = luabind::object_cast<uint32>(handin_table[i.key()]); |
| 5671 | LogNpcHandinDetail("Handin key [{}] value [{}]", key, handin_map[key]); |
| 5672 | } |
| 5673 | } |
| 5674 | |
| 5675 | return quest_manager.handin(handin_map); |
| 5676 | } |
| 5677 | |
| 5678 | luabind::object lua_get_paused_timers(lua_State* L, Mob* m) { |
| 5679 | auto t = luabind::newtable(L); |