Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hex master not working #5704

Closed
3 tasks done
QuickStick123 opened this issue Feb 22, 2023 · 6 comments · Fixed by #5705
Closed
3 tasks done

Hex master not working #5704

QuickStick123 opened this issue Feb 22, 2023 · 6 comments · Fixed by #5705
Labels
bug: calculation Numerical differences

Comments

@QuickStick123
Copy link
Contributor

QuickStick123 commented Feb 22, 2023

Check version

  • I'm running the latest version of Path of Building and I've verified this by checking the changelog

Check for duplicates

  • I've checked for duplicate issues by using the search function of the issue tracker

Check for support

  • I've checked that the calculation is supposed to be supported. If it isn't please open a feature request instead (Red text is a feature request).

What is the value from the calculation ingame?

Infinite

What is the value from the calculation in Path of Building?

No effect
image
image
image

Was working #5193 but got broken at some point?

How to reproduce the issue

No response

Character build code

https://pobb.in/e_qCFf-Boy6T

Screenshots

No response

@QuickStick123 QuickStick123 added the bug: calculation Numerical differences label Feb 22, 2023
@Paliak
Copy link
Contributor

Paliak commented Feb 22, 2023

Caused by math.huge being saved as inf` in modCache.lua which when parsed turns into nil.

@Paliak
Copy link
Contributor

Paliak commented Feb 22, 2023

Changing:

else
out:write(tostring(v))
end

To:

else
    if v == math.huge then
        out:write("math.huge")
      else
        out:write(tostring(v))
      end
end

Fixes the problem. I'll make a pr later today.

@Wires77
Copy link
Member

Wires77 commented Feb 22, 2023

Looks like this just needs a ModCache refresh, actually. Refreshing current dev with Ctrl+F5 results in the proper parsing:

image

Still not sure what messed it up to begin with, but it's fixed now. Reopen if you can reproduce it with a fresh cache.

@Wires77 Wires77 closed this as completed Feb 22, 2023
@Paliak
Copy link
Contributor

Paliak commented Feb 22, 2023

@Wires77 When you rebuild cache with ctrl-f5 pob uses the newly build cache directly. It does not load it from file. If you do ctrl-f5 to rebuild the cache the value will be correct. Then if you reload with f5 or restart pob the cache will be loaded from file, which causes the issue.

tostring(math.huge) == "inf" but assigning inf to a variable causes it to become nil then during mod eval the value property is defaulted to 0.

This is how the mod looks like after being written to ModCache.lua :

c["Your Hexes have infinite Duration"]={{[1]={[1]={skillType=79,type="SkillType"},flags=0,keywordFlags=0,name="Duration",type="BASE",value=inf}},nil}

This is the result of it being interpreted by lua:
obraz

@Wires77
Copy link
Member

Wires77 commented Feb 22, 2023

Ah, okay, I thought Ctrl+F5 rebuilt the file and then loaded from that file for some reason (probably lack of caffeine). I'll go look for the errant commit with that in mind, then. I'd like to see what caused the issue, partially out of curiosity, partially out of feeling like the proposed spot to fix it seems a bit hacky.

Edit: Well, the first commit I tested ( 3eacbd3 ) already doesn't work, so I don't think this ever worked. I just Ctrl+F5, then F5 and saw this same issue. That fix will probably be necessary then.

@Wires77 Wires77 reopened this Feb 22, 2023
@Paliak
Copy link
Contributor

Paliak commented Feb 22, 2023

I'm not too happy with that explicit if statement either but i can't think of any other way of fixing it. I don't think lua has any built in means of serializing itself into a valid lua file like the mod cache saving function attempts to do.

Another thing to consider would be to replace the the serializing logic for the cache with something that can handle such cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: calculation Numerical differences
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants