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
Decoupled cMonster and path recalc logic, re-implemented recalc. #2668
Conversation
if (m_JumpCoolDown == 0) | ||
{ | ||
if (DoesPosYRequireJump(FloorC(m_NextWayPointPosition.y))) | ||
{ | ||
if ( | ||
(IsOnGround() && (GetSpeedX() == 0.0f) && (GetSpeedY() == 0.0f)) || | ||
(IsSwimming() && (m_GiveUpCounter < 15)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember touching these two lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like the fix to avoid taking fall damage while swimming in water
Nope, that was player, not mob
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO investigate this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Monster.cpp no longer has a GiveUpCounter
, this is why I edited this line. It breaks jumping in water, but AI water handling is pretty broken altogether, so this isn't an issue. We'll get back to this when water handling is fixed.
Edit: Fixed
|
} | ||
|
||
// TODO fix monster heads | ||
// TODO why does PATH_NOT_FOUND even occur? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Irrelevant TODO comments, already fixed in this commit
D'you know what? Why don't you just merge yourself after you've finished your own review? :P |
} | ||
|
||
if (ReachedFinalDestination()) | ||
if ((m_NextWayPointPosition - GetPosition()).Length() < GetWidth()/2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space around the /
Also, add extra parentheses to conditions. (GetWidth() / 2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nah, the extra parenthesis is not really needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not? The convention says that it needs to be like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The convention says "parenthesis around comparisons", not "parenthesis around comparison operands"
Similarly, we write if (a > b + 2)
instead of if (a > (b + 2))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But isn't that bad? It looks awful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The lua script missed this one.
It took me a while to realize that I'm actually using |
Do not merge yet, even if CI succeeds. |
Rebased. |
The last commit fixes idle mob issues. |
Also, I used a pointer because it explicitly indicates that the Pathfinder may modify the finalDestination. WIth references, I found myself putting comments all over the place to prevent confusion. |
lgtm. Rebased. |
@param a_Destination The position the mob would like to reach. If a_ExactPath is true, the PathFinder may modify this. | ||
@param a_OutputWaypoint An output parameter: The next waypoint to go to. | ||
@param a_DontCare If true, the mob doesn't care where to go, and the Pathfinder may modify a_Destination. | ||
This should usually be true. An exception is a wandering idle mob which doesn't care about its final destination. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should usually be false.
There are still a few TODOs. Will they be done in a other pull request, someday? |
@Seadragon91 Which TODOs are you referring to? |
@Seadragon91 lgtm. |
Decoupled cMonster and path recalc logic, re-implemented recalc.
Do not merge yet. This needs review. This is in pretty good shape, but not yet complete.Fixes #2536
Known issues: