From 99712f363bd594cdded65f07ab0027abf17377f1 Mon Sep 17 00:00:00 2001 From: chenyueqi Date: Wed, 21 Apr 2021 16:48:20 +0800 Subject: [PATCH] gm get hero 不能获取未开发的英雄 --- src/actions/GmAction.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/actions/GmAction.lua b/src/actions/GmAction.lua index e004b64..d20acfc 100644 --- a/src/actions/GmAction.lua +++ b/src/actions/GmAction.lua @@ -301,9 +301,13 @@ function _M.get(role, pms) end end elseif pms.pm1 == "HERO" then - for itemId = 400 , 700 do + local unitCsv = csvdb["unitCsv"] + for itemId = 400 , 800 do if csvdb["itemCsv"][itemId] then - role:award({[itemId] = 1}, {log = {desc = "gm"}}) + local heroUnit = unitCsv[itemId - 300] + if heroUnit.open == 1 then + role:award({[itemId] = 1}, {log = {desc = "gm"}}) + end end end elseif pms.pm1 == "MAXHERO" then -- libgit2 0.21.2