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/missile pos other clients #127

Merged
merged 3 commits into from
Oct 25, 2023
Merged

Conversation

TTENSHII
Copy link
Collaborator

@TTENSHII TTENSHII commented Oct 24, 2023

  • Please check if the PR fulfills these requirements
  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Norm of the code has been respected
  • In what state is your pull request?
  • Ready to merge / Waiting a reviwer to see my work.
  • Work In Progress (WIP) / My work is not finish but i want daily reviews. (Draft)
  • CI Review / I want to see what the CI thinks of my work.
  • Need feedback / Just to have feedback on what i produced. (May not be merged)
  • What kind of change does this PR introduce? (You can choose multiple)
  • Bug fix
  • Feature request
  • New / Updated documentation
  • Testing CI ( Make the pull request in draft mode)
  • What is the current behavior? (link an issue based on the kind of change this pr introduce)

  • What is the new behavior (if this is a feature change)?

  • Other information:

Summary by CodeRabbit

  • Refactor: Improved missile positioning accuracy in the game. The changes allow for more precise control and adjustment of missile positions based on specific types, enhancing the gameplay experience.
  • Refactor: Streamlined the code for missile creation and positioning, removing redundant functions and simplifying the process. This change is expected to improve the game's performance and reliability.

Please note, these changes are under-the-hood improvements and won't result in noticeable visual changes in the game interface. However, they contribute to a smoother and more responsive gaming experience.

@TTENSHII TTENSHII self-assigned this Oct 24, 2023
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 24, 2023

Walkthrough

The changes primarily focus on improving missile positioning in the game. The adjustMissilePosition function has been enhanced to use collision rect data from a JSON object. The playerShootBullet function now uses this improved function. The getMissileId function is no longer static and the adjustMissilePosition function has been removed from BulletsSystems.cpp.

Changes

File Path Summary
src/Client/Systems/Events/... Enhanced adjustMissilePosition for better missile positioning. Updated playerShootBullet to use the improved function.
src/ECS/Systems/BulletsSystems.cpp Removed static keyword from getMissileId and removed adjustMissilePosition.
src/ECS/Systems/Systems.hpp Added getMissileId function to the Systems namespace.

🐇

"In the world of code, where missiles glide,

Changes were made, with much pride.

Positioning improved, with data from JSON,

Making the game, much more fun.

So here's to the devs, who work day and night,

To make our virtual battles, an exciting fight!" 🎮🚀


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.json

@TTENSHII TTENSHII added the bug Something isn't working label Oct 24, 2023
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between c5c128d and 4a9f165.
Files selected for processing (3)
  • src/Client/Systems/Events/EventsSystems.cpp (2 hunks)
  • src/ECS/Systems/BulletsSystems.cpp (3 hunks)
  • src/ECS/Systems/Systems.hpp (1 hunks)
Files skipped from review due to trivial changes (2)
  • src/ECS/Systems/BulletsSystems.cpp
  • src/ECS/Systems/Systems.hpp
Additional comments: 2
src/Client/Systems/Events/EventsSystems.cpp (2)
  • 85-109: The adjustMissilePosition function has been updated to include a new parameter missileTypes_e typeOfMissile. This function now uses collision rect data from a JSON object to adjust missile positions. The function also uses the new getMissileId function to get the missile ID from the missile type. Ensure that all calls to this function throughout the codebase have been updated to match the new signature and that the JSON object contains the necessary data. Also, verify that the getMissileId function is correctly implemented and returns the expected results.

  • 132-136: The adjustMissilePosition function is now used in playerShootBullet to adjust the missile position before creating and sending a bullet message. This replaces the previous adjustPlayerBulletPosition function. Ensure that this change does not affect the game's functionality and that the missile positions are correctly adjusted.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 4a9f165 and 54e5d52.
Files selected for processing (1)
  • src/Client/Systems/Events/EventsSystems.cpp (2 hunks)
Additional comments: 2
src/Client/Systems/Events/EventsSystems.cpp (2)
  • 85-109: The adjustMissilePosition function has been updated to include a new parameter missileTypes_e typeOfMissile. This function now adjusts missile positions based on collision rect data from a JSON object, improving the accuracy of missile positioning. The function also uses the new getMissileId function to get the missile ID from the missile type. Ensure that the JSON object contains the correct data for each missile type and that the getMissileId function correctly identifies each missile type.

  • 132-136: The playerShootBullet function has been updated to replace the adjustPlayerBulletPosition function with a call to adjustMissilePosition, ensuring consistent missile positioning before creating and sending a bullet message. This change should improve the accuracy of missile positioning in the game.

@guillaumeAbel guillaumeAbel merged commit 2d64fe2 into dev Oct 25, 2023
@Saverio976 Saverio976 deleted the fix/missile-pos-other-clients branch March 4, 2024 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants