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(modules/hooks): return proper response, if neither hook fails #664

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

coblyox
Copy link
Contributor

@coblyox coblyox commented Jan 26, 2025

Description

This pretty much fixes wrong hooks response.

TLDR: If neither hook fails, expected response is true. With current implementation, it returns nil which is considered as false and will always fail.

Simple example:

if not triggerEventHooks('removeMoney', {
  source = player.PlayerData.source,
  moneyType = moneyType,
  amount = amount
}) then return false end

If there's any hooks registered for removeMoney, it will always fail even though hooks return true.

Checklist

  • I have personally loaded this code into an updated Qbox project and checked all of its functionality.
  • My pull request fits the contribution guidelines & code conventions.

@coblyox coblyox changed the title fix: return response, if neither hook returns false fix(modules/hooks): return proper response, if neither hook fails Jan 26, 2025
@FjamZoo FjamZoo merged commit bcb1ff4 into Qbox-project:main Jan 28, 2025
2 checks passed
@coblyox coblyox deleted the hooks-fix branch January 28, 2025 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants