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

ulocate parameters generated wrongly #39

Closed
tomforwood opened this issue Sep 24, 2021 · 2 comments
Closed

ulocate parameters generated wrongly #39

tomforwood opened this issue Sep 24, 2021 · 2 comments

Comments

@tomforwood
Copy link

the input
ulocate(building,core, false, outx, outy,found,myCore)
generates
ulocate building core false @copper outx outy __tmp10 found
I think it should be
ulocate building core false @copper outx outy found, myCore

It looks like it has decided to hard code the found parameter of ulocate to a new temporary variable to use it as the result.

If thios is a deliberate descision then perhaps it could be documented in the syntax?

@francois
Copy link
Collaborator

francois commented Sep 27, 2021 via email

@cardillan
Copy link
Owner

The problem with this code:

ulocate(building,core, false, outx, outy,found,myCore)

is that the found argument corresponds to function return value. Expected syntax for this statement is:

found = ulocate(building,core, false, outx, outy, myCore)

which generates correct instruction

ulocate building core false @copper outx outy found myCore

For a complete descriptions of functions and their mappings to ML instructions see Function reference for Mindustry Logic 7.

This issue was closed.
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

3 participants