opentibiabr / canary

Canary Server 13.x for OpenTibia community.
https://docs.opentibiabr.com/
GNU General Public License v2.0
384 stars 637 forks source link

fix: resolve nil index issue in destroy script callback #3117

Closed omarcopires closed 1 week ago

omarcopires commented 1 week ago

Description

Fixed an error in the item destruction script where calling ActionsLib.destroyItem resulted in a nil reference. The function call was adjusted to use destroyItem directly, ensuring the script works correctly and avoids global index errors.

Fixes

Interface: Scripts Interface
Script ID: D:\Repositorios Git\baiak-yurots\data-canary/scripts\actions\other\destroy.lua:callback
Error Description: ...iak-yurots\data-canary/scripts\actions\other\destroy.lua:253: attempt to index global 'ActionsLib' (a nil value)
stack traceback:
        [C]: in function '__index'
        ...iak-yurots\data-canary/scripts\actions\other\destroy.lua:253: in function <...iak-yurots\data-canary/scripts\actions\other\destroy.lua:252>

Type of change

Checklist

sonarcloud[bot] commented 1 week ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud