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: check null pointer from master on no-pvp combat #3357

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kaleohanopahala
Copy link
Contributor

@kaleohanopahala kaleohanopahala commented Feb 10, 2025

Now the code checks for a null target right away to prevent crashes.
The summon condition is moved up, eliminating redundant checks.
Unnecessary null verifications (like if (target && ...)) have been removed.
Validations for tile properties and PvP conditions are reorganized for clearer and more efficient logic.

Note:
Reopened because i accidentally deleted all branches haha.

@myallith
Copy link
Contributor

Github Actions 5 x 0 Leilani :D

Line 355:
const auto targetMonster = target->getMonster();

Change to:
const auto &targetMonster = target->getMonster();
Line 359:
const auto attackerMonster = attacker->getMonster();

Change to:
const auto &attackerMonster = attacker->getMonster();

@murilo09 murilo09 changed the title fix: check null pointer from master on no-pvp combat. fix: check null pointer from master on no-pvp combat Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants