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

PlacementManager CurrentEraserMouseCoordinates fix #5576

Merged

Conversation

southbridge-fur
Copy link
Contributor

@southbridge-fur southbridge-fur commented Dec 26, 2024

Resolves #5575

With the recent modification to this method to remove deprecated calls, it appears a bug was introduced which messed up the coordinates being used in PlacementManager's CurrentEraserMouseCoordinates. It appears the issue has something to do with how the call to the ToCoordinates method includes an entity which causes it to seemingly convert the coordinates to be relative to the entity, which isn't very conducive to the erase method here. One day I hope to understand the coordinate systems in this game so I can know if my read on this is correct, but today is not that day.

I've resolved the issue by using a different method overload for EntityCoordinates's ToCoordinates which doesn't have an argument for the entity.

This seems to work rather well, however during testing I noticed a new bug, which threw an endless stream of error messages if I happened to mouse over any UI element. I've added an additional fix for this, which simply checks whether the MapId we're moused over is equal to the MapId.Nullspace value. This bug is also present in the current version of the code, so I figured I'd resolve it as well.

My fix for this simply causes the method to return its false result, which functionally just makes the selector freeze in place while you're mousing over UI elements. It doesn't feel the best, but I fail to understand the coordinate systems in this game, so I won't be resolving that.

FIXED.mp4

@southbridge-fur
Copy link
Contributor Author

the day I finally understand the coordinate systems will be the day I implement copy-paste (and completely overhaul PlacementManager)

@ElectroJr
Copy link
Member

the day I finally understand the coordinate systems

It's not that complicated, but placement manager is really not the place to learn, its shitty, partially ancient code that no one has properly cleaned up in a long time.

Point in case, the bug here was only possible because placement manager is hot garbage and was and is still assuming that the entity coordinates are relative to the map.

@ElectroJr ElectroJr merged commit fb70570 into space-wizards:master Dec 28, 2024
3 checks passed
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.

PlacementManager's Erase method is behaving strangely
2 participants