Avorion

Avorion

Zee's Mining & Salvaging Systems
ZeeHtaa  [developer] Apr 19, 2021 @ 4:11am
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 ;)
< >
Showing 1-2 of 2 comments
kanadaj Apr 19, 2021 @ 7:15am 
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
Last edited by kanadaj; Apr 22, 2021 @ 4:12am
kanadaj Apr 19, 2021 @ 7:50am 
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
Last edited by kanadaj; Apr 19, 2021 @ 7:56am
< >
Showing 1-2 of 2 comments
Per page: 1530 50