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

Crash to desktop when upgrading/morphing unit that is carrying resources into one that cannot #599

Open
Kaitrei opened this issue Jan 12, 2024 · 0 comments

Comments

@Kaitrei
Copy link

Kaitrei commented Jan 12, 2024

This is one I've been running into for a while and I didn't think to report it as I had a less than ideal workaround. The prototype I'm working on is heavily dependent on the idea of your main ground units being able to upgrade/train into every other job as it's a hybrid RTS/colony sim. Being able to turn your workers into militia or fighters.

As of 3.3.2 and earlier, when you try to upgrade a unit that is currently carrying resources into one that cannot carry the resource it's carrying, the game immediately crashes to desktop and produces an error log I cannot make sense of.

My current workaround has been to set all resource harvesters to drop their resources once they stop their current order and to make it so the upgrade buttons are unavailable if a unit is acting on any other order. (They have to stand still to upgrade.) I don't like that I have to set "lose-resources" for every resource on my workers, so I'd like to propose one of two changes to fix this:

  1. Add a check at the end of a unit upgrade/morph that checks if the new unit can carry the resources the current unit is carrying. If not, clear carried resources. (I know enough C/C++ that I might be able to implement this solution if someone can point me in the right .cpp files to add this in, but I'm not set up to compile.)
  2. Add flag that you can set in Buttons.lua that lets you enable/disable a button only if a unit is/isn't carrying any resources, taking away the ability to upgrade the unit while it's carrying resources or limiting it to upgrade paths that can carry resources.
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

1 participant