BibliothecaDAO / eternum

onchain eternal game
https://alpha-eternum.realms.world
MIT License
46 stars 34 forks source link

contracts: set correct battle position #920

Closed credence0x closed 3 months ago

credence0x commented 3 months ago

PR Type

Bug fix


Description


Changes walkthrough ๐Ÿ“

Relevant files
Bug fix
contracts.cairo
Fix battle position assignment in combat system                   

contracts/src/systems/combat/contracts.cairo
  • Corrected the assignment of the battle_position coordinates.
  • Changed battle_position.y to battle_position.x for the x-coordinate.
  • +1/-1     

    ๐Ÿ’ก PR-Agent usage: Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    vercel[bot] commented 3 months ago

    The latest updates on your projects. Learn more about Vercel for Git โ†—๏ธŽ

    Name Status Preview Comments Updated (UTC)
    eternum โœ… Ready (Inspect) Visit Preview ๐Ÿ’ฌ Add feedback Jun 13, 2024 9:18am
    github-actions[bot] commented 3 months ago

    PR Reviewer Guide ๐Ÿ”

    โฑ๏ธ Estimated effort to review [1-5] 2
    ๐Ÿงช Relevant tests No
    ๐Ÿ”’ Security concerns No
    โšก Key issues to review None
    github-actions[bot] commented 3 months ago

    PR Code Suggestions โœจ

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    Validate the corrected assignment of the x coordinate to ensure it aligns with the intended combat system logic ___ **It appears that there was a typo in the original code where the y coordinate of
    battle_position was mistakenly set using attacking_army_position.x. The correction to use
    attacking_army_position.x for battle_position.x is appropriate. However, ensure that this
    change is consistent with the intended logic of the combat system, as coordinate
    assignments can have significant effects on gameplay and mechanics.** [contracts/src/systems/combat/contracts.cairo [344]](https://github.com/BibliothecaDAO/eternum/pull/920/files#diff-4bdcda25a764215afd907449c2bb112a726bf3281fc1a7e6b9f7f0d4351ddb52R344-R344) ```diff -battle_position.x = attacking_army_position.x; +battle_position.x = attacking_army_position.x; # Ensure this assignment is intentional and correct ```
    Suggestion importance[1-10]: 7 Why: The suggestion correctly identifies a potential issue with the coordinate assignment and advises validation to ensure it aligns with the intended logic of the combat system. This is important for maintaining the integrity of gameplay mechanics.
    7