Prevent accidental wallmounted_to_dir poisoning by mods #15810
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'll copy paste the commit's description (but slightly edited to correct things):
Prior to this commit, if you used a function like
core.wallmounted_to_dir
, and modified its output, it would modify all of the output in the futureSo, something like this:
This would result in some bugs that are really hard to catch if you don't know this undocumented behavior
Now that i'm writing this i realize i made an error in the commit description, line 9 of the commit description was supposed to have
result: (0, 2, 0)
notresult: (0, 1, 0)
, and in line 10 i have putcore.get_wallmounted_to_dir(0)
when i should've putcore.wallmounted_to_dir(0)
, i'm never making commit descriptions againI don't know how to change the commit message description, besides just making a new fork and PR, is this a problem?
Uses vector.copy on outputs of
core.wallmounted_to_dir
,core.fourdir_to_dir
,core.facedir_to_dir
so that can't happenNot in the issue tracker, but in discord (i reported it):
https://discord.com/channels/369122544273588224/369123175583186964/1341121598895423591
The content of the message:
(i was completely clueless about it back then)
No
To do
This PR is Ready for Review.
How to test