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

Spring.GetUnitWeaponHaveFreeLineOfFire has terrible interface #1846

Open
sprunk opened this issue Dec 22, 2024 · 0 comments
Open

Spring.GetUnitWeaponHaveFreeLineOfFire has terrible interface #1846

sprunk opened this issue Dec 22, 2024 · 0 comments
Labels
area: documentation Improvements or additions to documentation area: Lua API bug Something isn't working

Comments

@sprunk
Copy link
Collaborator

sprunk commented Dec 22, 2024

  • it has four different argument sets, making it hard to intuit what is going on.
  • worse, arguments overlap between the sets, but are on different positions. For example in one set, 3rd arg is a target unitID. In another, you can also pass target unitID but it's now the 6th arg, with 3rd arg being the source X coordinate.
  • none of these are documented.
  • it seems to have a similar problem as Spring.ShareResources(teamID, "units", nil) breaks #1826 where an explicit nil changes behaviour (by making it interpret args according to a different set).
  • there doesn't seem to be a set that would check against the weapon's current target. There is one that seems to check line of fire towards {0, 0, 0} coordinates, oversight?
@sprunk sprunk added bug Something isn't working area: documentation Improvements or additions to documentation area: Lua API labels Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: documentation Improvements or additions to documentation area: Lua API bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant