|
楼主 |
发表于 2024-2-8 10:45:18
|
显示全部楼层
function getRooms(name, city, type)
local type = type or "all"
local isLookCity = type == "all" or type == "look"
local isTaskCity = type == "all" or type == "task"
if string.find(name,"/") then
return {name}
end
local isNameFw = string.find(name,"^%l+$")
local isCityFw = city and string.find(city,"^%l+$")
local rooms = {}
for id,room in pairs(map.rooms) do
local roomName = isNameFw and getFirstWord(room.name) or room.name
if roomName == name then
if not city then
table.insert(rooms,id) |
|