diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index 42a5f97909db03f9be1709cca8c749263224c826..d282b736bfc330807c9004891d3c64298569bc53 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -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) diff --git a/game/modules/tome/class/GameState.lua b/game/modules/tome/class/GameState.lua index 5ea24a01d96cac92e7806b3f79d18b91bab2ecfc..5099596aa1a9cab2ed215bd6e49150f925b1abd9 100644 --- a/game/modules/tome/class/GameState.lua +++ b/game/modules/tome/class/GameState.lua @@ -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