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

hs_evolving_object.time_days is unusable #18

Open
Dfred opened this issue Aug 14, 2023 · 1 comment
Open

hs_evolving_object.time_days is unusable #18

Dfred opened this issue Aug 14, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@Dfred
Copy link
Collaborator

Dfred commented Aug 14, 2023

in my lua module, defining time_days = 0.5 lead to this error:

WARNING: Object failed to generate, discarding: evolvingObject
[string "hammerstone-framework/..ject/objectManager.lua"]:924: attempt to perform arithmetic on local 'yearTime' (a nil value)

using github repo.

@Dfred Dfred changed the title hs_evolving_object.time_years is unusable hs_evolving_object.time_days is unusable Aug 14, 2023
@DecDuck
Copy link
Member

DecDuck commented Aug 14, 2023

I think the issue is here:

if dayTime and yearTime then
    log:schema("ddapi", "   WARNING: Evolving defines both 'time_years' and 'time_days'. You can only define one.")
end

Where (for some reason) Lua is treated the AND operator as a arithmetic operator. I'm not sure how Lua handles falsy/truthy values, but casting to booleans should fix the issue. I'll see if I can draft up a PR later today.

@DecDuck DecDuck added the bug Something isn't working label Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants