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

improve: adjustment in player event #1860

Merged
merged 6 commits into from
Nov 28, 2023

Conversation

luanluciano93
Copy link
Contributor

@luanluciano93 luanluciano93 commented Nov 21, 2023

Description

• Renamed the 'config' Table for Clarity: The table previously known as 'config' has been renamed to enhance readability and understanding of its purpose.
• Added Conditional Checks to Prevent Null Returns: Implemented multiple conditional statements throughout the code to ensure that functions do not return null values, thereby improving the reliability and stability of the code.
• Optimized 'exhaust' Table Handling: Moved the 'exhaust' table outside of the function's scope for better efficiency. Additionally, set its value to null at the end of the addEvent function to ensure proper cleanup and prevent data persistence issues.

Behaviour

Actual

can generate errors, such as:
[error] Lua script error: scriptInterface: [Event Interface] scriptId: [data/events/scripts/player.lua:Player@onMoveItem] timerEvent: [] callbackId:[] function: [] error [data/events/scripts/player.lua:249: attempt to index a nil value stack traceback: [C]: in function '__index' data/events/scripts/player.lua:249: in function <data/events/scripts/player.lua:234>]

Expected

do not generate errors.

Fixes #issuenumber

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Test Configuration:

  • Server Version: canary main
  • Client: 13.21
  • Operating System: Windows

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I checked the PR checks reports
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

@luan
Copy link
Contributor

luan commented Nov 21, 2023

@luanluciano93 can you explain what this this in the description please? I can review the code but if I don't know what you're trying to do it's hard to do it quickly..

@dudantas
Copy link
Member

I understand the intention behind the proposed changes in the pull request, but it's important to be cautious when altering code that is already functioning correctly. Changes like these can be prone to introducing bugs, especially if not well understood or documented. Could you please provide more details about the changes you are proposing? Additionally, I request that you follow our project's standard pull request template, which will help us better understand the context and rationale for these changes.

@luanluciano93
Copy link
Contributor Author

done

@dudantas dudantas merged commit 0ddbe02 into opentibiabr:main Nov 28, 2023
10 checks passed
@dudantas dudantas changed the title improve: ajustment player event improve: adjustment in player event Nov 28, 2023
@luanluciano93 luanluciano93 deleted the ajustmentPlayerEvent branch December 2, 2023 21:46
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.

4 participants