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

equipment-outfitter.lua: Interpret MILITARY as tech level 11. #6046

Closed

Conversation

pghvlaans
Copy link
Contributor

The function Outfitter:renderCompareRow() in equipment-outfitter.lua assumes a numeric value. This causes a GUI crash in the equipment outfitter when selecting an item with the tech level MILITARY due to attempting either number formatting (if the slot is empty) or a numeric comparison (if the slot is full).

Give this the same handling as MILITARY level stations get by changing the level to 11 for comparison and display.

fix #6039

@sturnclaw
Copy link
Member

I'd strongly recommend you change modifyEquipmentStats() to transform 'MILITARY'->11 there instead - it's significantly less intrusive to fix it at the "source" as it were. Otherwise this is a good change, thank you for proposing it!

@pghvlaans
Copy link
Contributor Author

Makes sense, thanks! It should be OK now.

@impaktor
Copy link
Member

impaktor commented Feb 8, 2025

I've not looked at the code in context of other code, but just be aware that military tech level could be construed as "level 11", except it has equipment unique to it, that is not available at tech level 12.

All other tech levels are "bigger = better", i.e. all other tech levels have everything offered at the lower (except this virtual tech level 11 = military level")

@pghvlaans pghvlaans marked this pull request as draft February 8, 2025 17:04
@pghvlaans
Copy link
Contributor Author

that is not available at tech level 12.

I just checked Torvalds Platform (level 12) and it had military stuff for sale, so the latest commit won't work. I'll have another look tomorrow.

@pghvlaans
Copy link
Contributor Author

There's a bit more going on here:

  • stationHasTech makes "MILITARY" equipment available in level 12 stations
  • Two of the military drives have tech level 11 and 12, respectively, which makes them available in level 12 stations anyway
  • 11 is a distinct tech level from "MILITARY", so the output probably shouldn't say 11

I'll close and open a new PR.

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

Successfully merging this pull request may close these issues.

GUI module crash while trying to install hull auto-repair
3 participants