-
Notifications
You must be signed in to change notification settings - Fork 291
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
Fix loading of old resizable equipment #6182
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6182 +/- ##
=========================================
Coverage 29.17% 29.17%
- Complexity 13971 13975 +4
=========================================
Files 2628 2628
Lines 266564 266560 -4
Branches 47575 47574 -1
=========================================
+ Hits 77771 77781 +10
+ Misses 184910 184895 -15
- Partials 3883 3884 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
short and sweet, would be interesting to refactor some of those operations (at a later date) to be in another component, since there is so much repetition.
You could probably just generate and parse blk files as XML if you took the time to rewrite all the code |
that is true, will put a pin on that, I'd prefer to make other things work first before moving to this kind of modernization. however we do have the benefit of being able to work however we want with the parse (which is super simple and easy to use) and not be liable to many security risks that there are with using XML parsers due to how powerful they are. |
That would require loading and re-saving EVERY BLK file and still supporting the old format. BLK is NOT XML despite what it looks like. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's good, but as @Scoppio said this wants to be a static parseVariableSize() method in BLKFile
The check for :SIZE: has to happen where it happens for the rest of the parsing code to work, and I didn't want to do a heuristic-based regex match against every single equipment line before being able to make the check for This I'm comfortable shipping in 0.50.1, a more involved rewrite of the BLK code I would want to have more testing on. |
Fixes #6179.
Fixes old mtf/blk files with cargo, liquid storage, communications equipment, ladders, mission equipment, or other resizable gear.
New unit files store resizable gear in a format like
Cargo:SIZE:5
.Old unit files store them in a format like
Cargo (5 tons)
, and this was never addressed when the switch to the new format was made.This reintroduces support for unit files made in this older style, which includes most of the unit files presently in MM's data.