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

Regression of existing content with new CFG parser #1132

Closed
Kenny-Hui opened this issue Mar 17, 2025 · 3 comments
Closed

Regression of existing content with new CFG parser #1132

Kenny-Hui opened this issue Mar 17, 2025 · 3 comments

Comments

@Kenny-Hui
Copy link
Contributor

Description

When parsing integers in a cfg file, the parsing will completely fail when met with a double value/decimal number.
This unfortunately caused some not-so-well-formed panel cfg files to fail to load completely (Exists in some legacy BVE trains such as 1992TS):

;Digital Clock
[DigitalNumber]
Subject = sec
Location = 654,802
DaytimeImage = BVE4cab\clock.png
NighttimeImage = BVE4cab\clock.png
TransparentColor =  #976529
Layer = 16
Interval = 31.5 <---- (Integer expected)

It also seems like the error message is not correctly produced:
Value [163, 31.5] is not a valid integer in Key DigitalNumber in Section DigitalNumber at line 163
Where [163, 31.5] should only show 31.5, and Key DigitalNumber should show the problematic key instead of the section key. (Key Interval)

Related information

  • Operating system: Arch Linux
  • Method of control: Keyboard
@leezer3
Copy link
Owner

leezer3 commented Mar 17, 2025

Thanks.

I've fixed that, and added a new warning for that case.
The sections should now be right too.

@Kenny-Hui
Copy link
Contributor Author

Also s is a KeyValuePair, we probably want s.Value when logging the value.

leezer3 added a commit that referenced this issue Mar 17, 2025
@Kenny-Hui
Copy link
Contributor Author

Fixed, thanks :)

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

No branches or pull requests

2 participants