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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emitter stacks fix #13539
Emitter stacks fix #13539
Conversation
Because 0 is used for machines that don't anchor or deanchor. 1 is used for success in all the machine procs that I wrote in that rewrite, and -1 is used for failure. Anything using wrenchAnchor was written after that fact, and its assumptions are wrong. |
@@ -564,7 +564,8 @@ Class Procs: | |||
to_chat(user, "\The [src] has to be unwelded from the floor first.") | |||
return -1 //state set to 2, can't do it | |||
else | |||
if(wrenchAnchor(user) && machine_flags && FIXED2WORK) //wrenches/unwrenches into place if possible, then updates the power and state if necessary | |||
// wrenchAnchor returns -1 on check failures, for some reason. | |||
if(wrenchAnchor(user) == 1 && machine_flags && FIXED2WORK) //wrenches/unwrenches into place if possible, then updates the power and state if necessary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How long has this check even been like this - that should be a bitwise &.
I'll go over the code at some point and replace the -1 and 1 occurances with success and failure defines. |
* Exploit fix for machine stacking. * Fixes made during testing. * Fix some minor indentation issues. * honk
Executive Summary
Fixes a stacking exploit with some machinery.
Technical information
Some fucktard decided that
/obj/wrenchAnchor()
should return -1 instead of 0 on failure. Guess what all other code assumes?This also checks to see if we should anchor AFTER the do_after, in case a new dense object is added after the wait.
Changelog
馃啈