-
-
Notifications
You must be signed in to change notification settings - Fork 681
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
Fixes wrong signal usages #10875
Fixes wrong signal usages #10875
Conversation
RegisterSignalsDynamic(parent, change_on, PROC_REF(handle_change)) | ||
RegisterSignalsDynamic(parent, remove_on, PROC_REF(handle_removal)) |
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.
If you wonder how TG managed that, here you are:
// change on can be a list of signals
if(islist(change_on))
RegisterSignals(parent, change_on, PROC_REF(handle_change))
else if(!isnull(change_on))
RegisterSignal(parent, change_on, PROC_REF(handle_change))
// remove on can be a list of signals
if(islist(remove_on))
RegisterSignals(parent, remove_on, PROC_REF(handle_removal))
else if(!isnull(remove_on))
RegisterSignal(parent, remove_on, PROC_REF(handle_removal))
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.
I would rather cover this edge case than add a DEFINE that's used twice and will be quickly forgotten about.
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.
Addressed
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.
Good catches
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
d35cbe0
to
fdbca0a
Compare
* Signal fixes * Removes dynamic macro * I didn't save this.. Removes dynamic macro. * Update COMPONENT_TEMPLATE.md * nitpick * nitpick 2
About The Pull Request
Fixes wrong signal usages
Regex search to find issues
RegisterSignals\([a-zA-Z_]+, COMSIG
: searches for signals with wrong usage - RegisterSignals should take listChanges into
RegisterSignal
RegisterSignals\([a-zA-Z_]+, list\(COMSIG[a-zA-Z_]+\)
: searches for a signal with a single listChanges into
RegisterSignal
RegisterSignal\([a-zA-Z_]+, list
: searches for signals with wrong usage - It can be a list orChanges into
RegisterSignals
RegisterSignal([s]?)\([a-zA-Z_]+, [a-z_]+
: searches for signals that might have been taken variableChanges into
RegisterSignals
RegisterSignal([s]?)\([a-zA-Z,/\s_]+\/proc
: searches for non-macro procs for signalsChanges into
TYPE_PROC_REF()
Why It's Good For The Game
Bug fix, runtime fix, etc
Testing Photographs and Procedure
This isn't what I can't test fully
Changelog
🆑
code: fixed wrong usage of signal procs
/:cl: