Commit 4720134d58cd5fe0846ed911b360ed75641cb874
- Diff rendering mode:
- inline
- side by side
src/being.cpp
(7 / 1)
|   | |||
| 575 | 575 | // Update the player sprite direction | |
| 576 | 576 | int direction = 0; | |
| 577 | 577 | const float dx = std::abs(dir.x); | |
| 578 | const float dy = std::abs(dir.y); | ||
| 578 | float dy = std::abs(dir.y); | ||
| 579 | |||
| 580 | // When not using mouse for the player, we slightly prefer | ||
| 581 | // UP and DOWN position, especially when walking diagonally. | ||
| 582 | if (this == player_node && !player_node->isPathSetByMouse()) | ||
| 583 | dy = dy + 2; | ||
| 584 | |||
| 579 | 585 | if (dx > dy) | |
| 580 | 586 | direction |= (dir.x > 0) ? RIGHT : LEFT; | |
| 581 | 587 | else |
src/localplayer.cpp
(2 / 2)
|   | |||
| 302 | 302 | ||
| 303 | 303 | const Vector &pos = getPosition(); | |
| 304 | 304 | ||
| 305 | // Compute where the next step will set. | ||
| 305 | // Compute where the next step will be set. | ||
| 306 | 306 | ||
| 307 | 307 | int dx = 0, dy = 0; | |
| 308 | 308 | if (dir & UP) | |
| … | … | ||
| 342 | 342 | } | |
| 343 | 343 | } | |
| 344 | 344 | ||
| 345 | if (dScaler >= 0) | ||
| 345 | if (dScaler > 0) | ||
| 346 | 346 | { | |
| 347 | 347 | //effectManager->trigger(15, (int) pos.x + (dx * dScaler), (int) pos.y + (dy * dScaler)); | |
| 348 | 348 | setDestination((int) pos.x + (dx * dScaler), (int) pos.y + (dy * dScaler)); |
src/localplayer.h
(5 / 1)
|   | |||
| 367 | 367 | ||
| 368 | 368 | std::pair<int, int> getExperience(int skill); | |
| 369 | 369 | ||
| 370 | /** Tells the path has been set by mouse */ | ||
| 370 | /** Tells that the path has been set by mouse. */ | ||
| 371 | 371 | void pathSetByMouse() | |
| 372 | 372 | { mPathSetByMouse = true; } | |
| 373 | |||
| 374 | /** Tells if the path has been set by mouse. */ | ||
| 375 | bool isPathSetByMouse() const | ||
| 376 | { return mPathSetByMouse; } | ||
| 373 | 377 | ||
| 374 | 378 | bool mUpdateName; /** Whether or not the name settings have changed */ | |
| 375 | 379 |

