Skip to content
Snippets Groups Projects
Commit 891f5774 authored by DarkGod's avatar DarkGod
Browse files

Rare items/randarts with negative life will not always spawn with the max value

parent 444b72e8
No related branches found
No related tags found
No related merge requests found
......@@ -1580,14 +1580,11 @@ function _M:setupCommands()
print("===============")
end end,
[{"_g","ctrl"}] = function() if config.settings.cheat then
collectgarbage("collect")
local nb = 0
for k, e in pairs(__uids) do nb = nb + 1 end
game.log("NB: " .. nb)
for z, _ in pairs(engine.Zone.__zone_store) do
game.log("Zone store: " .. z.name)
local o = game.zone:makeEntity(game.level, "object", {random_object=true}, nil, true)
if o then
o:identify(true)
game.zone:addEntity(game.level, o, "object", game.player.x, game.player.y)
end
do return end
local f, err = loadfile("/data/general/events/fearscape-portal.lua")
print(f, err)
......
......@@ -413,8 +413,14 @@ function _M:generateRandart(data)
if type(e) == "table" then
if e.__resolver and e.__resolver == "randartmax" then
dst[k] = (dst[k] or 0) + e.v
if dst[k] > e.max * scale then --Adjust maximum values for higher levels
dst[k] = math.floor(e.max * scale)
if e.max < 0 then
if dst[k] < e.max * scale then --Adjust maximum values for higher levels
dst[k] = math.floor(e.max * scale)
end
else
if dst[k] > e.max * scale then --Adjust maximum values for higher levels
dst[k] = math.floor(e.max * scale)
end
end
else
if not dst[k] then dst[k] = {} end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment