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

Fixed unstore_unit lua code (issue #5519) #5521

Merged
merged 2 commits into from
Feb 13, 2021
Merged

Conversation

MrTitainin
Copy link
Contributor

x,y were both binding to whole table instead of their expected values
#5519 should now be solved, although there still might be problem with location_id in teleport code

x,y were both binding to whole table instead of their expected values
@github-actions github-actions bot added the Lua API Issues with the Lua engine and API. label Feb 6, 2021
@soliton-
Copy link
Member

soliton- commented Feb 9, 2021

Can you fix the call for teleport a couple lines down as well?

@CelticMinstrel
Copy link
Member

I see, whoever wrote that (was it me?) must've thought that special_locations returns two values rather than a table. This fix seems fine, if a little ugly. Could also use … I think it's table.unpack?

x, y = table.unpack(wesnoth.special_locations[whatever])

It doesn't really matter, though.

And changed [unstore_unit] to use table.unpack for shorter code
@MrTitainin
Copy link
Contributor Author

MrTitainin commented Feb 11, 2021

This should address both your concerns.
I also changed priority in [teleport] so that now location_id overrides x and y if present, like in [unstore_unit], but I don't think it will affect anyone, as it's unnecessary to use both in the same tag.

@Vultraz
Copy link
Member

Vultraz commented Feb 13, 2021

Just to confirm, table.unpack worked fine?

@Vultraz Vultraz merged commit 6bb8544 into wesnoth:master Feb 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Lua API Issues with the Lua engine and API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants