Commit 99712f363bd594cdded65f07ab0027abf17377f1

Authored by chenyueqi
1 parent 1ebe1c94

gm get hero 不能获取未开发的英雄

Showing 1 changed file with 6 additions and 2 deletions   Show diff stats
src/actions/GmAction.lua
@@ -301,9 +301,13 @@ function _M.get(role, pms) @@ -301,9 +301,13 @@ function _M.get(role, pms)
301 end 301 end
302 end 302 end
303 elseif pms.pm1 == "HERO" then 303 elseif pms.pm1 == "HERO" then
304 - for itemId = 400 , 700 do 304 + local unitCsv = csvdb["unitCsv"]
  305 + for itemId = 400 , 800 do
305 if csvdb["itemCsv"][itemId] then 306 if csvdb["itemCsv"][itemId] then
306 - role:award({[itemId] = 1}, {log = {desc = "gm"}}) 307 + local heroUnit = unitCsv[itemId - 300]
  308 + if heroUnit.open == 1 then
  309 + role:award({[itemId] = 1}, {log = {desc = "gm"}})
  310 + end
307 end 311 end
308 end 312 end
309 elseif pms.pm1 == "MAXHERO" then 313 elseif pms.pm1 == "MAXHERO" then