Created
March 10, 2016 02:58
-
-
Save segrax/e8df323288f6223a56ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If MF_NEW_LEG is not set, then do nothing at all | |
If MF_TURN is not set, then just walk one step | |
If MF_TURN is set | |
we have reached a walk target (may not be the users requested destination) | |
If MF_IN_LEG is set, we have reached our final destination/target. Stop Actor Moving completely | |
If MF_IN_NOT is not set, we have reached the current target | |
Check the walk box number, is it the final destination walk box | |
Yes: Set the next walk destination to the X/Y the user clicked, set MF_IN_LEG… do calcMovementFactor | |
No: Get the next walkbox, check its flags, calculate the point we should walk to inside this box (towards the final destination), do calcMovementFactor | |
calcMovementFactor disables MF_TURN, | |
calculates the walk distance / direction, calls walk step. | |
Unless walk distance is 0, in which case it sets MF_TURN and does nothing else | |
Walkstep: increases or decreases the X and Y value depending on which direction we are walking (it will do both, IF your walking on enough of an angle) | |
Sets MF_TURN once the current destination has been reached |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/scummvm/scummvm/blob/v1.9.0/engines/scumm/actor.cpp#L1073