-
-
Notifications
You must be signed in to change notification settings - Fork 658
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: eventcallbacks which returns a ReturnValue #2532
fix: eventcallbacks which returns a ReturnValue #2532
Conversation
Tested with the proposed changes and it's working fine! Just change the README to the new operation. |
as suggested by luanluciano93. Thank you, Luan! Co-authored-by: Luan Luciano <[email protected]>
…thub.com/lamonato29/canary into fix-eventcallback-creatureontargetcombat
This comment was marked as outdated.
This comment was marked as outdated.
in the README file the example of a callback with Boolean return is creatureOnAreaCombat |
Fixed! Thank you, Luan. |
@lamonato29 Correct the return in this script https://github.com/opentibiabr/canary/blob/main/data/scripts/eventcallbacks/creature/on_area_combat.lua#L4 |
Done! Thx. |
Description
This PR fixes eventcallbacks whose returns were in type conflict (creatureOnAreaCombat and creatureOnTargetCombat)
Behaviour
Actual
The eventcallback does not start.
Expected
Now, we can use ReturnValue, instead of true or false, to stop an attack execution, for example.
The old events system (data/events/scripts/creature.lua for example) runs first, then, if it succeed, the new eventcallback system runs too.
Tibia.-.Palaum.2024-04-08.16-31-58.mp4
Be Careful with custom scripts returning true or false. It may fail.
Fixes #2529
Type of change
Please delete options that are not relevant.