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 AIR_DRAG_DEFAULT and AIR_DRAG_NONE constants #219

Open
frosch123 opened this issue Jun 3, 2021 · 2 comments
Open

Add AIR_DRAG_DEFAULT and AIR_DRAG_NONE constants #219

frosch123 opened this issue Jun 3, 2021 · 2 comments

Comments

@frosch123
Copy link
Member

@frosch123 frosch123 commented Jun 3, 2021

The air_drag_coefficient property of trains and road vehicles has some magic values:

  • Integer 0: use some default max_speed-dependent value.
  • Integer 1: apply no air drag.

Currently NML applies unit conversion to this value, so to get no air drag you have to set "1/255", while "0" does something entirely different.

@FLHerne
Copy link
Contributor

@FLHerne FLHerne commented Jun 3, 2021

nitpick: Most NML constants have the 'enum name' first, so these should probably be AIR_DRAG_DEFAULT and AIR_DRAG_NONE or similar.

Loading

@frosch123 frosch123 changed the title Add DEFAULT_DRAG and NO_DRAG constants Add AIR_DRAG_DEFAULT and AIR_DRAG_NONE constants Jun 3, 2021
@FLHerne
Copy link
Contributor

@FLHerne FLHerne commented Jul 2, 2021

We should also ensure that the unit conversion handles this properly -- i.e. generate 1 for zero and 2 for other values below 2/255.

EDIT: of course, that would break grfs using 1/255 as the workaround you mentioned... might need a warning.

Loading

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 pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants