Commit ae8c3e89728ddc1f8e91e6e54ded039fd1fa600f
- Diff rendering mode:
- inline
- side by side
src/gui/viewport.cpp
(1 / 0)
|   | |||
| 378 | 378 | mLocalWalkTime = tick_time; | |
| 379 | 379 | player_node->setDestination(event.getX() + (int) mPixelViewX, | |
| 380 | 380 | event.getY() + (int) mPixelViewY); | |
| 381 | player_node->pathSetByMouse(); | ||
| 381 | 382 | } | |
| 382 | 383 | #else | |
| 383 | 384 | player_node->setDestination(tilex, tiley); |
src/localplayer.cpp
(9 / 3)
|   | |||
| 103 | 103 | mTrading(false), mGoingToTarget(false), mKeepAttacking(false), | |
| 104 | 104 | mLastAction(-1), | |
| 105 | 105 | mWalkingDir(0), | |
| 106 | mPathSetByMouse(false), | ||
| 106 | 107 | mDestX(0), mDestY(0), | |
| 107 | 108 | mInventory(new Inventory(INVENTORY_SIZE)), | |
| 108 | 109 | #ifdef TMWSERV_SUPPORT | |
| … | … | ||
| 539 | 539 | player_node->stopWalking(false); | |
| 540 | 540 | ||
| 541 | 541 | // Else, he is not pressing a key, | |
| 542 | // And the current path is over. Then, stop (sending to server). | ||
| 543 | else if (!dir && mPath.empty()) | ||
| 542 | // and the current path hasn't been sent by mouse, | ||
| 543 | // then, stop (sending to server). | ||
| 544 | else if (!dir) | ||
| 544 | 545 | { | |
| 545 | player_node->stopWalking(true); | ||
| 546 | if (!mPathSetByMouse) | ||
| 547 | player_node->stopWalking(true); | ||
| 546 | 548 | return; | |
| 547 | 549 | } | |
| 548 | 550 | ||
| … | … | ||
| 643 | 643 | getPosition().y); | |
| 644 | 644 | setAction(STAND); | |
| 645 | 645 | } | |
| 646 | |||
| 647 | // No path set anymore, so we reset the path by mouse flag | ||
| 648 | mPathSetByMouse = false; | ||
| 646 | 649 | ||
| 647 | 650 | clearPath(); | |
| 648 | 651 | } |
src/localplayer.h
(5 / 0)
|   | |||
| 367 | 367 | ||
| 368 | 368 | std::pair<int, int> getExperience(int skill); | |
| 369 | 369 | ||
| 370 | /** Tells the path has been set by mouse */ | ||
| 371 | void pathSetByMouse() | ||
| 372 | { mPathSetByMouse = true; } | ||
| 373 | |||
| 370 | 374 | bool mUpdateName; /** Whether or not the name settings have changed */ | |
| 371 | 375 | ||
| 372 | 376 | bool mMapInitialized; /** Whether or not the map is available yet */ | |
| … | … | ||
| 428 | 428 | bool mKeepAttacking; /** Whether or not to continue to attack */ | |
| 429 | 429 | int mLastAction; /**< Time stamp of the last action, -1 if none. */ | |
| 430 | 430 | int mWalkingDir; /**< The direction the player is walking in. */ | |
| 431 | bool mPathSetByMouse; /**< Tells if the path was set using mouse */ | ||
| 431 | 432 | int mDestX; /**< X coordinate of destination. */ | |
| 432 | 433 | int mDestY; /**< Y coordinate of destination. */ | |
| 433 | 434 |

