【青龙秘宝】======奖励添加空判断
parent
417fdfa650
commit
bb3f825aa9
|
@ -230,30 +230,33 @@ function this:showRewardQinglong()
|
||||||
for j=1,#reward.Reward do
|
for j=1,#reward.Reward do
|
||||||
local id = reward.Reward[j].item[1]
|
local id = reward.Reward[j].item[1]
|
||||||
local num = reward.Reward[j].item[2]
|
local num = reward.Reward[j].item[2]
|
||||||
if reward.Reward[j].type == 2 then
|
if id~=0 then
|
||||||
if not indirect[id] then
|
if reward.Reward[j].type == 2 then
|
||||||
indirect[id] = 0
|
if not indirect[id] then
|
||||||
end
|
indirect[id] = 0
|
||||||
indirect[id] = indirect[id] + num
|
|
||||||
|
|
||||||
if reward.state ~= -1 then
|
|
||||||
if level >= reward.level then
|
|
||||||
if not direct[id] then
|
|
||||||
direct[id] = 0
|
|
||||||
end
|
|
||||||
direct[id] = direct[id] + num
|
|
||||||
end
|
end
|
||||||
end
|
indirect[id] = indirect[id] + num
|
||||||
else
|
|
||||||
if reward.state == 0 or reward.state == -2 then
|
if reward.state ~= -1 then
|
||||||
if level >= reward.level then
|
if level >= reward.level then
|
||||||
if not direct[id] then
|
if not direct[id] then
|
||||||
direct[id] = 0
|
direct[id] = 0
|
||||||
|
end
|
||||||
|
direct[id] = direct[id] + num
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if reward.state == 0 or reward.state == -2 then
|
||||||
|
if level >= reward.level then
|
||||||
|
if not direct[id] then
|
||||||
|
direct[id] = 0
|
||||||
|
end
|
||||||
|
direct[id] = direct[id] + num
|
||||||
end
|
end
|
||||||
direct[id] = direct[id] + num
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
this:SetItem(direct,indirect)
|
this:SetItem(direct,indirect)
|
||||||
|
|
Loading…
Reference in New Issue