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

Fix regression & replace more occurrences of vector.new with vector.copy #12539

Merged
merged 6 commits into from
Jul 14, 2022

Conversation

appgurueu
Copy link
Contributor

Fixes #12537. vector.new(nil) is the null vector (deprecated). I missed this possibility when replacing vector.new with vector.copy: Pointed things may be entities.

@SmallJoker SmallJoker added Bugfix 🐛 PRs that fix a bug @ Builtin labels Jul 14, 2022
@sfan5 sfan5 added the Trivial The change is a trivial bug fix, documentation or maintenance change, as per the Git Guidelines label Jul 14, 2022
@sfan5
Copy link
Member

sfan5 commented Jul 14, 2022

Add a regression test?
(Alternatively you can view it not as a regression test but as increasing the test coverage of our API, of which there is basically none).

@appgurueu
Copy link
Contributor Author

Add a regression test?

For a local function? This is used as a helper for in-game stuff, I don't see how testing it would be feasible.

@sfan5
Copy link
Member

sfan5 commented Jul 14, 2022

For minetest.punch_node

@appgurueu
Copy link
Contributor Author

For minetest.punch_node

Do we have a decent framework for multiplayer tests?

@sfan5
Copy link
Member

sfan5 commented Jul 14, 2022

Have you looked into games/devtest/mods/unittests recently?

@appgurueu
Copy link
Contributor Author

Have you looked into games/devtest/mods/unittests recently?

No, thanks for pointing me to that. Are these locations documented somewhere?

@sfan5
Copy link
Member

sfan5 commented Jul 14, 2022

No, this would fit well into a wiki page documenting our source structure but we don't have one.

@appgurueu appgurueu force-pushed the fix-regression branch 2 times, most recently from 2cdf169 to 54d08e2 Compare July 14, 2022 16:39
@sfan5
Copy link
Member

sfan5 commented Jul 14, 2022

Uh wait, the test is failing. That means punch_node doesn't do what lua_api.txt promises.

You can comment it out for now, that's for another PR/time.

@appgurueu
Copy link
Contributor Author

appgurueu commented Jul 14, 2022

Uh wait, the test is failing. That means punch_node doesn't do what lua_api.txt promises.

You can comment it out for now, that's for another PR/time.

Nah, it was punching an air node (my bad). The server correctly discarded that. Registered a test node to punch.

@sfan5 sfan5 added WIP The PR is still being worked on by its author and not ready yet. and removed Trivial The change is a trivial bug fix, documentation or maintenance change, as per the Git Guidelines One approval ✅ ◻️ labels Jul 14, 2022
@appgurueu appgurueu changed the title Fix crash introduced by replacing vector.new with vector.copy Fix regression & replace more occurrences of vector.new with vector.copy Jul 14, 2022
@appgurueu
Copy link
Contributor Author

Fixed whatever grep -rE "vector\.new\([^\,]*\)" found (minus the false-positives and tests in vector_spec.lua).

Copy link
Member

@sfan5 sfan5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏝️

@sfan5 sfan5 removed the WIP The PR is still being worked on by its author and not ready yet. label Jul 14, 2022
@sfan5
Copy link
Member

sfan5 commented Sep 18, 2022

Why did the unittest that was added here fail again?

@appgurueu
Copy link
Contributor Author

Not sure. You might find something in the IRC logs.

@sfan5
Copy link
Member

sfan5 commented Sep 18, 2022

https://irc.minetest.net/minetest-dev/2022-07-14#i_5994326

17:12 	sfan5 	one reason could be that the map is not loaded but that'd be a major fail of the test framework
17:12 		have fun debugging this

🤷

@appgurueu appgurueu deleted the fix-regression branch March 31, 2024 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lua API Regression: "minetest.punch_node(pos)"
3 participants