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

Fixed pathfinding related to magic fields #4213

Closed
wants to merge 1 commit into from

Conversation

EPuncker
Copy link
Contributor

Co-Authored-By: Zbizu Zbizu@users.noreply.github.com

Pull Request Prelude

Changes Proposed

Fixed pathfinding related to magic fields.

Issues addressed:
closes #4210

Co-Authored-By: Zbizu <Zbizu@users.noreply.github.com>
Copy link
Member

@nekiro nekiro left a comment

Choose a reason for hiding this comment

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

Use FLAG_IGNOREFIELDDAMAGE

in tile::queryAdd add elseif for players (like the one for monsters)

if (!hasBitSet(FLAG_IGNOREFIELDDAMAGE, flags)) {
    return RETURNVALUE_NOTPOSSIBLE;
}

and don't pass it for players

Proposed changes:
https://github.com/nekiro/forgottenserver/compare/master...field-pathfinding?expand=1

Comment on lines +639 to +646
uint32_t searchFlags = FLAG_PATHFINDING;
if (!creature.getPlayer()) {
// monster pathfinding (monster ai)
searchFlags |= FLAG_IGNOREFIELDDAMAGE;
} else {
// player pathfinding (walk to use, rotate, etc.)
searchFlags |= FLAG_CHECKMOVABLE;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

invert this

@nekiro nekiro mentioned this pull request Oct 17, 2022
3 tasks
@EPuncker EPuncker closed this Oct 19, 2022
@EPuncker EPuncker deleted the bug-4210 branch October 19, 2022 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clicking Use in the middle of fire bomb fields causes running into the fields
4 participants