Avorion
Zee's Mining & Salvaging Systems
ZeeHtaa  [开发者] 2021 年 4 月 19 日 上午 4:11
Bug Reports
I made a seperate place for bug reports.

When reporting bugs, please provide a step by step guide, so i know how i can reproduce them.
No reproduction > no fixing ;)
< >
正在显示第 1 - 2 条,共 2 条留言
kanadaj 2021 年 4 月 19 日 上午 7:15 
Okay, here is the repro for the bug for the refinery:
1) Get a refinery with "Can smelt Scrap" on both Install and Permanent Install
2) Install it
3) Scrap smelting works
4) Permanently install it
5) Scrap smelting doesn't work anymore

In fact, here is the error in the code:

The tooltip (refinery.lua line 322) says "can smelt scrap" even if canScrapBonus is false, but on line 912, 1025 and 1137 you override canScrap with canScrapBonus. So the tooltip says it can smelt scrap but the bonus was defined as false and got overridden.

EDIT: Another issue is that on line 75, you are reading "canScrap" instead of "canScrapBonus"

In fact, you are doing a fundamental mistake by not re-seeding the random function on line 208. To avoid breaking things, I recommend adding this to line 208:

math.randomseed(seed)
math.random()

and replace the canScrap assignment with this:

-- CAN SCRAP
local canScrap = false
if math.random() < 0.5 then
canScrap = true
end

local canScrapBonus = false
if canScrap or math.random() < 0.5 then
canScrapBonus = true
end

Then return both canScrap and canScrapBonus from the same call.

This will re-seed the random and rolls a blank on it to reset the state to what it would be. Right now random will have an offset of 1 if the mod is installed temporarily, or 2 if it's installed permanently, which messes with canScrap. At the same time you need to also generate canScrapBonus in the same method instead of a second roll
最后由 kanadaj 编辑于; 2021 年 4 月 22 日 上午 4:12
kanadaj 2021 年 4 月 19 日 上午 7:50 
Also, any idea why the icon of the C64 and Salvage System could be missing? I'm only getting a checkerboard icon.

EDIT: The textures folder seems to be in the wrong folder, it should be under data, not in the root folder. i.e. textures are under 2040989882\textures\icons but getIcon references them to be at 2040989882\data\textures\icons
最后由 kanadaj 编辑于; 2021 年 4 月 19 日 上午 7:56
< >
正在显示第 1 - 2 条,共 2 条留言
每页显示数: 1530 50