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

Add: show an error if a required property is not set for objects (feature 0F) #236

Merged
merged 2 commits into from Oct 10, 2021

Conversation

@glx22
Copy link
Contributor

@glx22 glx22 commented Sep 1, 2021

Other features may use this, but I only checked ttdpatch source for objects.

Closes #191.

@FLHerne
Copy link
Contributor

@FLHerne FLHerne commented Sep 1, 2021

I think this should be an error and not a warning, since there's no question it's incorrect and will fail.

Loading

"size": {"custom_function": object_size}, # = prop 0C
"name": {"size": 2, "num": 0x0A, "string": 0xD0, "required": None},
"climates_available": {"size": 1, "num": 0x0B, "required": None},
"size": {"custom_function": object_size, "required": None}, # = prop 0C
Copy link
Member

@LordAro LordAro Sep 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd use True here to be clearer, even though the value doesn't actually matter

Loading

@planetmaker
Copy link
Contributor

@planetmaker planetmaker commented Sep 1, 2021

I'd second the comments by FLHerne and LordAro. Both make it clearer and better readable.

Loading

…ture 0F)

Other features may use this, but I only checked ttdpatch source for objects.
@glx22 glx22 changed the title Add: warn if a required property is not set for objects (feature 0F) Add: show an error if a required property is not set for objects (feature 0F) Sep 1, 2021
@glx22
Copy link
Contributor Author

@glx22 glx22 commented Sep 1, 2021

Maybe I should also consider "first" as "required".

And I guess nmlc should be smart enough to move a "first" property on first place in the list (and still warn of course).

Loading

@glx22 glx22 merged commit 8565776 into OpenTTD:master Oct 10, 2021
21 checks passed
Loading
@glx22 glx22 deleted the properties branch Oct 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants