Closed SiverDX closed 2 months ago
I have just tested it and update
method is called when the category is locked. I used the following Command Reward to test it and got message lock
after locking the category, which means the update
was called.
{
"type": "puffish_skills:command",
"data": {
"unlock_command": "say unlock",
"lock_command": "say lock"
}
}
Method dispose
is called only when the whole reward is no longer needed. For example, it is called when data is reloaded. Keep in mind that rewards are not created per player, but per skill definition. This means that one reward instance handles multiple players.
Not sure if this is related, but thanks to this issue I found a bug where calling SkillsAPI.updateRewards
can cause update
method to be called on rewards even if the category is locked. Considering built-in rewards it only affects Attribute Reward which is updated by SkillsAPI.updateRewards
when the player respawns, so it can cause this reward to be applied even when the category is locked.
Locking the category itself works as intended
I meant that as: locking the category itself does work and it calls the proper methods
but the command to lock one singular skill does not call the proper methods
Oh, sorry I somehow misread that. :sweat_smile:
I have successfully managed to reproduce it now. Thanks for reporting, I'll fix it.
Fixed in 0.13.0.
Locking the category itself works as intended
But if I lock a skill with
/puffish_skills skills lock
theupdate(final RewardUpdateContext context)
method is not called (neither isdispose
)