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

WIP Implement industry production cheat (#2147) #2417

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sebazzz
Copy link
Contributor

@Sebazzz Sebazzz commented Apr 10, 2024

Looking for some early feedback for implementing #2147

image

There is one bug I can't quite figure out. As shown above, at some point, the industry name seems to be partially freed (almost seems like garbage collection, because when it happens doesn't seem to be entirely deterministic), and eventually, it is fully freed and just points to garbage. It ends up deep in the string formatting, and one of the control characters triggers this code path.

image

Looking at how for instance the industries list window works, the industry object there is never passed around, only its ID. At point of rendering, then the actual industry is retrieved and the string of it is retrieved. My guess is that I need to do something similar, or simply buffer the industry names locally (since we're not developing for a 8086 anymore) for the duration the window is shown.

@AaronVanGeffen
Copy link
Member

Thanks for the PR. I'm not too familiar with the industry code, personally, but I am familiar with the cheats window, haha. I'm glad to see you added some more use to it.

Unfortunately, our dropdowns have limited capacity. Right now, they're limited to 40 items. This is problematic, as a scenario can have up to 128 industries in them. It might therefore be better to move the selection to the industry window, at least for now. Alternatively, you could list just the industry windows that are open by querying the WindowManager.

I realise this doesn't answer your question, but I didn't want your PR to sit here in the mean time.

If you'd like to chat or talk about this some time, please find us on Discord as well.

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.

None yet

2 participants