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

Add effectCanPlay(void) and effectCanPlay(s) #2466

Merged
merged 1 commit into from
Nov 1, 2022

Conversation

Vurv78
Copy link
Contributor

@Vurv78 Vurv78 commented Oct 29, 2022

Fixes #2411

Copy link
Contributor

@brandonsturgeon brandonsturgeon left a comment

Choose a reason for hiding this comment

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

Not that it means much, but this LGTM. Just one question about the hook name.

e2function number effectCanPlay(string name)
if not isAllowed(self) then return 0 end
if effect_blacklist[name] then return 0 end
if hook.Run( "Expression2_CanEffect", name:lower(), self ) == false then return 0 end
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this / should this be documented somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't add it, just parity with the old function that already had that function call.

da4eff1
Looks like it was already an undocumented list, now just an undocumented hook. Either way this would only really be relevant to developers specifically looking to block E2's effects, so they could just check the source of the function and find this hook.

Could maybe in the future compile these hooks into a wiki page

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool, sounds good to me.

@Vurv78 Vurv78 merged commit f5668d2 into wiremod:master Nov 1, 2022
@Vurv78 Vurv78 deleted the effect-burst branch November 1, 2022 19:06
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.

No e2function to check if the effect:play(string) will exceed the burst limit
2 participants